mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 11:32:11 +01:00
refactor(sonar): take read-only string parameters as std::string_view (cpp:S6009)
The Windows messaging helpers keep std::string, they need c_str().
This commit is contained in:
@@ -25,7 +25,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
TMemCell::TMemCell( scene::node_data const &Nodedata ) : basic_node( Nodedata ) {}
|
||||
|
||||
void TMemCell::UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask )
|
||||
void TMemCell::UpdateValues( std::string_view szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask )
|
||||
{
|
||||
if (CheckMask & basic_event::flags::mode_add)
|
||||
{ // dodawanie wartości
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
explicit TMemCell( scene::node_data const &Nodedata );
|
||||
// methods
|
||||
void
|
||||
UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
|
||||
UpdateValues( std::string_view szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
|
||||
bool
|
||||
Load(cParser *parser);
|
||||
void
|
||||
|
||||
@@ -105,7 +105,7 @@ bool TTrainParameters::UpdateMTable( scenario_time const &Time, std::string cons
|
||||
return UpdateMTable( Time.data().wHour, Time.data().wMinute + Time.data().wSecond * 0.0167, NewName );
|
||||
}
|
||||
|
||||
bool TTrainParameters::UpdateMTable(double hh, double mm, std::string const &NewName)
|
||||
bool TTrainParameters::UpdateMTable(double hh, double mm, std::string_view NewName)
|
||||
/*odfajkowanie dojechania do stacji (NewName) i przeliczenie opóźnienia*/
|
||||
{
|
||||
bool OK;
|
||||
@@ -205,7 +205,7 @@ TTrainParameters::TTrainParameters(std::string const &NewTrainName)
|
||||
NewName(NewTrainName);
|
||||
}
|
||||
|
||||
void TTrainParameters::NewName(std::string const &NewTrainName)
|
||||
void TTrainParameters::NewName(std::string_view NewTrainName)
|
||||
/*wstępne ustawienie parametrów rozkładu jazdy*/
|
||||
{
|
||||
TrainName = NewTrainName;
|
||||
|
||||
@@ -78,11 +78,11 @@ class TTrainParameters
|
||||
bool IsTimeToGo(double hh, double mm) const;
|
||||
// returns: difference between specified time and scheduled departure from current stop, in seconds
|
||||
double seconds_until_departure( double const Hour, double const Minute ) const;
|
||||
bool UpdateMTable(double hh, double mm, std::string const &NewName);
|
||||
bool UpdateMTable(double hh, double mm, std::string_view NewName);
|
||||
bool UpdateMTable( scenario_time const &Time, std::string const &NewName );
|
||||
bool RewindTimeTable( std::string actualStationName );
|
||||
explicit TTrainParameters( std::string const &NewTrainName = "none" );
|
||||
void NewName(std::string const &NewTrainName);
|
||||
void NewName(std::string_view NewTrainName);
|
||||
void UpdateVelocity(int StationCount, double vActual);
|
||||
bool LoadTTfile(std::string const &scnpath, int iPlus, double vmax);
|
||||
bool DirectionChange() const;
|
||||
|
||||
Reference in New Issue
Block a user