xj qian
2024-06-25 58c129e8f21f79396a822eaeadd78edf281b52a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
 
#include <system/base.hpp>
typedef unsigned long long  size_t; 
class nstring
{
public:
    static size_t length(const wchar_t*,int MaxCount=0);
    static wchar_t* clone(const wchar_t* psrc);
    static size_t find(const wchar_t* psrc, const wchar_t* substr,int pos = 0); 
    static const wchar_t* str(const wchar_t* psrc, const wchar_t* substr); 
    static wchar_t * set(wchar_t * psrc, int val); 
    static wchar_t* cpy(wchar_t* pdest, const wchar_t* psrc);
    static wchar_t* ncpy(wchar_t* pdest, const wchar_t* psrc,int nlen);
    static char* ncpy(char* pdest, const char* psrc,int nlen);
    static int cmp(const wchar_t* pstr1,const wchar_t* pstr2,int MaxCount=0);
    static int icmp(const wchar_t* pstr1,const wchar_t* pstr2,int MaxCount=0);
    static wchar_t* cat(wchar_t* pdest, wchar_t* psrc,int MaxCount=0);
    static const wchar_t* chr(const wchar_t* psrc, int val);
    static int coll(const wchar_t* pstr1,const wchar_t* pstr2);
    static size_t cspn(const wchar_t *_Str,const wchar_t *_Control);
    static wchar_t * error(const wchar_t *_ErrMsg);
    static wchar_t * toLower(wchar_t *_Str);
    static wchar_t * toUpper(wchar_t *_Str);
    static const wchar_t * pbrk(const wchar_t *_Str,const wchar_t *_Control);
    static wchar_t * rev(wchar_t *_Str);
    static int toInt(wchar_t *_Str);
    static int toInt64(wchar_t* _Str);
    static double toDouble(wchar_t* str);
    static wchar_t* trim(wchar_t* str);
    static wchar_t* ltrim(wchar_t* str);
    static wchar_t* rtrim(wchar_t* str);
   static wchar_t* trim_(wchar_t* str,wchar_t* dest);
    static wchar_t* ltrim_(wchar_t* str, wchar_t* dest);
    static wchar_t* rtrim_(wchar_t* str, wchar_t* dest);
 
public:
    static size_t length(const char*,int MaxCount=0);
    static char* clone(const char* psrc);
    static size_t find(const char* psrc, const char* substr,int pos = 0);
    static const char* str(const char* psrc, const char* substr); 
    static char * set(char * psrc, int val); 
    static char* cpy(char* pdest, const char* psrc);
    static int cmp(const char* pstr1,const char* pstr2,int MaxCount=0);
    static int icmp(const char* pstr1,const char* pstr2,int MaxCount=0);
    static char* cat(char* pdest, char* psrc,int MaxCount=0);
    static const char* chr(const char* psrc, int val);
    static int coll(const char* pstr1,const char* pstr2);
    static size_t cspn(const char *_Str,const char *_Control);
    static char * error(const char *_ErrMsg);
    static char * toLower(char *_Str);
    static char * toUpper(char *_Str);
    static const char * pbrk(const char *_Str,const char *_Control);
    static char * rev(char *_Str);
    static int toInt(char *_Str);
    static int toInt64(char* _Str);
    static double toDouble(char* str);
    static wchar_t * toWStr(int val);
    static wchar_t * toWStr(double val);
    static wchar_t * toWStr(int val,wchar_t* buffer, int maxLen=16);
    static wchar_t * toWStr(double val,wchar_t* buffer, int maxLen=31);
    static wchar_t* toWStr(LPARAM val);
    static wchar_t* toWStr(LPARAM val,wchar_t* buffer, int maxLen=31);
 
    static char* trim(char* str);
    static char* ltrim(char* str);
    static char* rtrim(char* str);
 
};