author | peter1138 |
Tue, 22 Jan 2008 07:27:06 +0000 | |
changeset 8374 | 7a1b6c89cb89 |
parent 7255 | 31eec725265f |
child 9111 | 48ce04029fe4 |
permissions | -rw-r--r-- |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
1 |
/* $Id$ */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
2 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
3 |
/** @file str.hpp */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
4 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
5 |
#ifndef STR_HPP |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
6 |
#define STR_HPP |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
7 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
8 |
#include <errno.h> |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
9 |
#include <stdarg.h> |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
10 |
#include "strapi.hpp" |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
11 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
12 |
/** Blob based string. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
13 |
template <typename Tchar, bool TcaseInsensitive> |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
14 |
struct CStrT : public CBlobT<Tchar> |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
15 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
16 |
typedef CBlobT<Tchar> base; ///< base class |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
17 |
typedef CStrApiT<Tchar, TcaseInsensitive> Api; ///< string API abstraction layer |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
18 |
typedef typename base::bsize_t bsize_t; ///< size type inherited from blob |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
19 |
typedef typename base::OnTransfer OnTransfer; ///< temporary 'transfer ownership' object type |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
20 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
21 |
/** Construction from C zero ended string. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
22 |
FORCEINLINE CStrT(const Tchar* str = NULL) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
23 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
24 |
AppendStr(str); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
25 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
26 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
27 |
/** Construction from C string and given number of characters. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
28 |
FORCEINLINE CStrT(const Tchar* str, bsize_t num_chars) : base(str, num_chars) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
29 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
30 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
31 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
32 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
33 |
/** Construction from C string determined by 'begin' and 'end' pointers. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
34 |
FORCEINLINE CStrT(const Tchar* str, const Tchar* end) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
35 |
: base(str, end - str) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
36 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
37 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
38 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
39 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
40 |
/** Construction from blob contents. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
41 |
FORCEINLINE CStrT(const CBlobBaseSimple& src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
42 |
: base(src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
43 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
44 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
45 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
46 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
47 |
/** Copy constructor. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
48 |
FORCEINLINE CStrT(const CStrT& src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
49 |
: base(src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
50 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
51 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
52 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
53 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
54 |
/** Take over ownership constructor */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
55 |
FORCEINLINE CStrT(const OnTransfer& ot) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
56 |
: base(ot) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
57 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
58 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
59 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
60 |
/** Grow the actual buffer and fix the trailing zero at the end. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
61 |
FORCEINLINE Tchar* GrowSizeNC(bsize_t count) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
62 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
63 |
Tchar* ret = base::GrowSizeNC(count); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
64 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
65 |
return ret; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
66 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
67 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
68 |
/** Append zero-ended C string. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
69 |
FORCEINLINE void AppendStr(const Tchar* str) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
70 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
71 |
if (str != NULL && str[0] != '\0') { |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
72 |
base::Append(str, (bsize_t)Api::StrLen(str)); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
73 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
74 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
75 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
76 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
77 |
/** Append another CStrT or blob. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
78 |
FORCEINLINE void Append(const CBlobBaseSimple& src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
79 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
80 |
if (src.RawSize() > 0) { |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
81 |
base::AppendRaw(src); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
82 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
83 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
84 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
85 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
86 |
/** Assignment from C string. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
87 |
FORCEINLINE CStrT& operator = (const Tchar* src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
88 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
89 |
base::Clear(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
90 |
AppendStr(src); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
91 |
return *this; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
92 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
93 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
94 |
/** Assignment from another CStrT or blob. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
95 |
FORCEINLINE CStrT& operator = (const CBlobBaseSimple& src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
96 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
97 |
base::Clear(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
98 |
base::AppendRaw(src); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
99 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
100 |
return *this; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
101 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
102 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
103 |
/** Assignment from another CStrT or blob. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
104 |
FORCEINLINE CStrT& operator = (const CStrT& src) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
105 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
106 |
base::Clear(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
107 |
base::AppendRaw(src); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
108 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
109 |
return *this; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
110 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
111 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
112 |
/** Lower-than operator (to support stl collections) */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
113 |
FORCEINLINE bool operator < (const CStrT &other) const |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
114 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
115 |
return (Api::StrCmp(base::Data(), other.Data()) < 0); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
116 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
117 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
118 |
/** Add formated string (like vsprintf) at the end of existing contents. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
119 |
int AddFormatL(const Tchar *format, va_list args) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
120 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
121 |
bsize_t addSize = Api::StrLen(format); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
122 |
if (addSize < 16) addSize = 16; |
7153
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
123 |
addSize += addSize / 2; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
124 |
int ret; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
125 |
int err = 0; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
126 |
for (;;) { |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
127 |
Tchar *buf = MakeFreeSpace(addSize); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
128 |
ret = Api::SPrintFL(buf, base::GetReserve(), format, args); |
7153
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
129 |
if (ret >= base::GetReserve()) { |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
130 |
/* Greater return than given count means needed buffer size. */ |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
131 |
addSize = ret + 1; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
132 |
continue; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
133 |
} |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
134 |
if (ret >= 0) { |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
135 |
/* success */ |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
136 |
break; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
137 |
} |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
138 |
err = errno; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
139 |
if (err != ERANGE && err != ENOENT && err != 0) { |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
140 |
/* some strange failure */ |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
141 |
break; |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
142 |
} |
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
143 |
/* small buffer (M$ implementation) */ |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
144 |
addSize *= 2; |
7153
149b6649a3e3
(svn r10427) -Fix: snprintf behaves differently in gcc than in VC causing unreadable artifacts in output. Now CStrT::AddFormatL() should behave correctly also when compiled by gcc (Rubidium)
KUDr
parents:
7116
diff
changeset
|
145 |
} |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
146 |
if (ret > 0) { |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
147 |
GrowSizeNC(ret); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
148 |
} else { |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
149 |
base::FixTail(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
150 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
151 |
return ret; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
152 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
153 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
154 |
/** Add formated string (like sprintf) at the end of existing contents. */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
155 |
int AddFormat(const Tchar *format, ...) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
156 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
157 |
va_list args; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
158 |
va_start(args, format); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
159 |
int ret = AddFormatL(format, args); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
160 |
va_end(args); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
161 |
return ret; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
162 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
163 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
164 |
/** Assign formated string (like vsprintf). */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
165 |
int FormatL(const Tchar *format, va_list args) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
166 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
167 |
base::Free(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
168 |
int ret = AddFormatL(format, args); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
169 |
return ret; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
170 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
171 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
172 |
/** Assign formated string (like sprintf). */ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
173 |
int Format(const Tchar *format, ...) |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
174 |
{ |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
175 |
base::Free(); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
176 |
va_list args; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
177 |
va_start(args, format); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
178 |
int ret = AddFormatL(format, args); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
179 |
va_end(args); |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
180 |
return ret; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
181 |
} |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
182 |
}; |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
183 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
184 |
typedef CStrT<char , false> CStrA; ///< Case sensitive ANSI/UTF-8 string |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
185 |
typedef CStrT<char , true > CStrCiA; ///< Case insensitive ANSI/UTF-8 string |
7255
31eec725265f
(svn r10562) -Fix: most of the MorphOS issues; MorphOS doesn't know about wchars, so disable all code that has to use wchars for MorphOS.
rubidium
parents:
7153
diff
changeset
|
186 |
#if defined(HAS_WCHAR) |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
187 |
typedef CStrT<wchar_t, false> CStrW; ///< Case sensitive unicode string |
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
188 |
typedef CStrT<wchar_t, true > CStrCiW; ///< Case insensitive unicode string |
7255
31eec725265f
(svn r10562) -Fix: most of the MorphOS issues; MorphOS doesn't know about wchars, so disable all code that has to use wchars for MorphOS.
rubidium
parents:
7153
diff
changeset
|
189 |
#endif /* HAS_WCHAR */ |
7116
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
190 |
|
6fc23a78df05
(svn r10389) -Add: CStrA, CStrCiA, CStrW, CStrCiW - case sensitive/insensitive ANSI/UNICODE string classes that support formatted (sprintf like) output.
KUDr
parents:
diff
changeset
|
191 |
#endif /* STR_HPP */ |