mirror of
https://github.com/Halofreak1990/XFXFramework
synced 2024-12-26 13:49:34 +01:00
WARNING!!! This revision cannot compile correctly. It is updated to reflect the many changes within the XFX project.
88 lines
2.8 KiB
C++
88 lines
2.8 KiB
C++
/********************************************************
|
|
* String.h *
|
|
* *
|
|
* XFX String definition file *
|
|
* Copyright © XFX Team. All Rights Reserved *
|
|
********************************************************/
|
|
#ifndef _SYSTEM_STRING_
|
|
#define _SYSTEM_STRING_
|
|
|
|
#include "Enums.h"
|
|
#include <System/Types.h>
|
|
|
|
namespace System
|
|
{
|
|
/// <summary>
|
|
/// Represents text as a series of Unicode characters.
|
|
/// </summary>
|
|
class String
|
|
{
|
|
private:
|
|
int m_arrayLength;
|
|
char m_firstChar;
|
|
int m_stringLength;
|
|
static const int TrimBoth = 2;
|
|
static const int TrimHead = 0;
|
|
static const int TrimTail = 1;
|
|
char* internalString;
|
|
|
|
public:
|
|
int Length();
|
|
static const String Empty;
|
|
|
|
String();
|
|
String(char c, int count);
|
|
String(char value[], int startIndex, int length); //Note: can also be used as String(char *value, int startIndex, int length);
|
|
String(char* value);
|
|
String(const String &obj); // Copy constructor
|
|
~String();
|
|
|
|
String Clone();
|
|
int Compare(String strA, String strB);
|
|
static String Concat(String values[]);
|
|
static String Concat(String str1, String str2, String str3, String str4);
|
|
bool Contains(char* value);
|
|
bool EndsWith(char* value);
|
|
bool Equals(const String obj);
|
|
bool Equals(const String str1, const String str2);
|
|
static char* Format(char* format, ...);
|
|
int IndexOf(char value);
|
|
int IndexOf(char value, int startIndex);
|
|
int IndexOf(char value, int startIndex, int count);
|
|
static bool IsNullOrEmpty(String value);
|
|
static String Join(String &separator, String value[]);
|
|
static String Join(String &separator, String value[], int startIndex, int count);
|
|
String PadLeft(int totalWidth);
|
|
String PadLeft(int totalWidth, char paddingChar);
|
|
String PadRight(int totalWidth);
|
|
String PadRight(int totalWidth, char paddingChar);
|
|
String Replace(char oldChar, char newChar);
|
|
String Replace(char* oldValue, char* newValue);
|
|
char** Split(String *separator, int count, StringSplitOptions_t options);
|
|
char** Split(String *separator, StringSplitOptions_t options);
|
|
char** Split(char separator[], int count, StringSplitOptions_t options);
|
|
char** Split(char separator[], StringSplitOptions_t options);
|
|
char** Split(char separator[], int count);
|
|
char** Split(char separator[]);
|
|
bool StartsWith(char* value);
|
|
String SubString(int startIndex);
|
|
String SubString(int startIndex, int length);
|
|
char *ToCharArray(int startIndex, int length);
|
|
char *ToCharArray();
|
|
String ToLower();
|
|
char* ToString();
|
|
String ToUpper();
|
|
|
|
bool operator!=(const String right);
|
|
bool operator==(const String right);
|
|
bool operator==(const char* right);
|
|
String operator=(const char* right);
|
|
String operator=(const String right);
|
|
char operator [](int index);
|
|
};
|
|
|
|
typedef String string;
|
|
}
|
|
|
|
#endif //_SYSTEM_STRING_
|