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. 2
      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); 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 ssize_t plString::Find(char ch, CaseSensitivity sense) const
{ {
if (sense == kCaseSensitive) { if (sense == kCaseSensitive) {

8
Sources/Plasma/CoreLib/plString.h

@ -454,13 +454,9 @@ public:
/** Convert the string to a double precision floating point value. */ /** Convert the string to a double precision floating point value. */
double ToDouble() const; 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. /** Construct a plString using a printf-like format string.
* This function should be called inside of vararg functions, such as * This function should be called inside of other vararg functions,
* plString::Format(). * but those should be eventually replaced with plFormat-based variants.
*/ */
hsDeprecated("plString::IFormat is deprecated -- use plFormat instead") hsDeprecated("plString::IFormat is deprecated -- use plFormat instead")
static plString IFormat(const char *fmt, va_list vptr); 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) void plStateDataRecord::IInitDescriptor(const plString& name, int version)
{ {
plStateDescriptor* sd = plSDLMgr::GetInstance()->FindDescriptor(name, 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) if (sd)
IInitDescriptor(sd); IInitDescriptor(sd);
} }

2
Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

@ -306,7 +306,7 @@ const char* plUnifiedTime::Print() const
// short year, month, day, hour, minute, second; // short year, month, day, hour, minute, second;
// GetTime(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", // s = plFormat("yr {} mo {} day {} hour {} min {} sec {}",
// year, month, day, hour, minute, second); // year, month, day, hour, minute, second);
s = Format("%c"); s = Format("%c");

Loading…
Cancel
Save