diff options
author | Blaymoira <none@none> | 2008-12-12 20:34:51 +0100 |
---|---|---|
committer | Blaymoira <none@none> | 2008-12-12 20:34:51 +0100 |
commit | ab59d3adcc2a4afc743afe1a998290b99ed95929 (patch) | |
tree | 198a3ddb3aba4e7505869bcb0d631d5a289b817f /src/shared/Util.h | |
parent | ec12b76b392d65f02ad1b2d48508771f77284b50 (diff) | |
parent | b6c288ca9fb271923f493ee39d78b5dc4b2a996f (diff) |
*Merged with 464.
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Util.h')
-rw-r--r-- | src/shared/Util.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/Util.h b/src/shared/Util.h index 44c0dda8370..b99cdb13bde 100644 --- a/src/shared/Util.h +++ b/src/shared/Util.h @@ -33,7 +33,7 @@ Tokens StrSplit(const std::string &src, const std::string &sep); void stripLineInvisibleChars(std::string &src); std::string secsToTimeString(uint32 timeInSecs, bool shortText = false, bool hoursOnly = false); -uint32 TimeStringToSecs(std::string timestring); +uint32 TimeStringToSecs(const std::string& timestring); std::string TimeToTimestampStr(time_t t); inline uint32 secsToTimeBitFields(time_t secs) @@ -97,11 +97,11 @@ inline void ApplyPercentModFloatVar(float& var, float val, bool apply) var *= (apply?(100.0f+val)/100.0f : 100.0f / (100.0f+val)); } -bool Utf8toWStr(std::string utf8str, std::wstring& wstr); +bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr); // in wsize==max size of buffer, out wsize==real string size bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize); -inline bool Utf8toWStr(std::string utf8str, wchar_t* wstr, size_t& wsize) -{ +inline bool Utf8toWStr(const std::string& utf8str, wchar_t* wstr, size_t& wsize) +{ return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize); } @@ -282,9 +282,9 @@ inline void wstrToLower(std::wstring& str) std::wstring GetMainPartOfName(std::wstring wname, uint32 declension); -bool utf8ToConsole(std::string utf8str, std::string& conStr); -bool consoleToUtf8(std::string conStr,std::string& utf8str); -bool Utf8FitTo(std::string str, std::wstring search); +bool utf8ToConsole(const std::string& utf8str, std::string& conStr); +bool consoleToUtf8(const std::string& conStr,std::string& utf8str); +bool Utf8FitTo(const std::string& str, std::wstring search); #if PLATFORM == PLATFORM_WINDOWS #define UTF8PRINTF(OUT,FRM,RESERR) \ @@ -313,6 +313,6 @@ bool Utf8FitTo(std::string str, std::wstring search); #endif bool IsIPAddress(char const* ipaddress); -uint32 CreatePIDFile(std::string filename); +uint32 CreatePIDFile(const std::string& filename); #endif |