CloverBootloader/rEFIt_UEFI/cpp_foundation/XString.cpp

63 lines
1.4 KiB
C++
Raw Normal View History

2020-04-23 15:20:48 +02:00
//*************************************************************************************************
//*************************************************************************************************
//
2020-03-12 15:40:38 +01:00
// STRING
2020-04-23 15:20:48 +02:00
//
// Developed by jief666, from 1997.
//
//*************************************************************************************************
//*************************************************************************************************
2020-03-12 15:40:38 +01:00
#if 0
2020-04-24 11:30:09 +02:00
#define DBG(...) printf__VA_ARGS__)
2020-03-12 15:40:38 +01:00
#else
#define DBG(...)
#endif
2020-08-17 21:40:52 +02:00
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
2020-03-12 15:40:38 +01:00
#include "XString.h"
#include "../../Include/Library/printf_lite.h"
2020-03-12 15:40:38 +01:00
const XString8 NullXString8;
const XString16 NullXString16;
const XString32 NullXString32;
2020-04-23 15:20:48 +02:00
const XStringW NullXStringW;
2020-03-12 15:40:38 +01:00
XString8 S8Printf(const char* format, ...)
2020-03-12 15:40:38 +01:00
{
2020-04-23 15:20:48 +02:00
va_list va;
2020-04-30 08:03:56 +02:00
XString8 str;
2020-03-12 15:40:38 +01:00
2020-04-23 15:20:48 +02:00
va_start (va, format);
str.vS8Printf(format, va);
va_end(va);
2020-03-12 15:40:38 +01:00
2020-04-23 15:20:48 +02:00
return str;
2020-03-12 15:40:38 +01:00
}
2020-04-23 15:20:48 +02:00
XStringW SWPrintf(const char* format, ...)
2020-03-12 15:40:38 +01:00
{
2020-04-23 15:20:48 +02:00
va_list va;
XStringW str;
2020-03-12 15:40:38 +01:00
2020-04-23 15:20:48 +02:00
va_start (va, format);
str.vSWPrintf(format, va);
va_end(va);
2020-03-12 15:40:38 +01:00
2020-04-23 15:20:48 +02:00
return str;
2020-03-12 15:40:38 +01:00
}
2020-04-23 15:20:48 +02:00
//XStringW SubString(const wchar_t *S, UINTN pos, UINTN count)
2020-03-12 15:40:38 +01:00
//{
2020-04-23 15:20:48 +02:00
// if ( wcslen(S)-pos < count ) count = wcslen(S)-pos;
// XStringW ret;
// ret.StrnCpy(S+pos, count);
//// return ( XStringW(S+pos, count) );
// return ret;
2020-03-12 15:40:38 +01:00
//}
//