Browse Source

Get rid of plString::Format

Michael Hansen 9 years ago
parent
commit
7a7293e8c6
  1. 9
      Sources/Plasma/CoreLib/plString.cpp
  2. 8
      Sources/Plasma/CoreLib/plString.h
  3. 2
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  4. 4
      Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

9
Sources/Plasma/CoreLib/plString.cpp

@ -550,15 +550,6 @@ plString plString::IFormat(const char *fmt, va_list vptr)
return plString::FromUtf8(buffer, chars);
}
plString plString::Format(const char *fmt, ...)
{
va_list vptr;
va_start(vptr, fmt);
plString str = IFormat(fmt, vptr);
va_end(vptr);
return str;
}
ssize_t plString::Find(char ch, CaseSensitivity sense) const
{
if (sense == kCaseSensitive) {

8
Sources/Plasma/CoreLib/plString.h

@ -454,13 +454,9 @@ public:
/** Convert the string to a double precision floating point value. */
double ToDouble() const;
/** Construct a plString using a printf-like format string. */
hsDeprecated("plString::Format is deprecated -- use plFormat instead")
static plString Format(const char *fmt, ...);
/** Construct a plString using a printf-like format string.
* This function should be called inside of vararg functions, such as
* plString::Format().
* This function should be called inside of other vararg functions,
* but those should be eventually replaced with plFormat-based variants.
*/
hsDeprecated("plString::IFormat is deprecated -- use plFormat instead")
static plString IFormat(const char *fmt, va_list vptr);

2
Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp

@ -129,7 +129,7 @@ void plStateDataRecord::IDeleteVarsList(VarsList& vars)
void plStateDataRecord::IInitDescriptor(const plString& name, int version)
{
plStateDescriptor* sd = plSDLMgr::GetInstance()->FindDescriptor(name, version);
//hsAssert( sd, plString::Format("Failed to find sdl descriptor: %s,%d. Missing legacy descriptor?", name.c_str(), version ).c_str() );
//hsAssert( sd, plFormat("Failed to find sdl descriptor: {},{}. Missing legacy descriptor?", name, version ).c_str() );
if (sd)
IInitDescriptor(sd);
}

4
Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

@ -306,8 +306,8 @@ const char* plUnifiedTime::Print() const
// short year, month, day, hour, minute, second;
// GetTime(year, month, day, hour, minute, second);
//
// s = plString::Format("yr %d mo %d day %d hour %d min %d sec %d",
// year, month, day, hour, minute, second);
// s = plFormat("yr {} mo {} day {} hour {} min {} sec {}",
// year, month, day, hour, minute, second);
s = Format("%c");
return s.c_str();

Loading…
Cancel
Save