- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_str.h

Go to the documentation of this file.

    00001 // Warning : If you need to use this file, include frost_utils_types.h
    00002 #include <string>
    00003
    00004 namespace Frost
    00005 {
    00006     /// Base type : string
    00007     /** Frost's base types are made to allow simpler
    00008     *   manipulation of numbers, booleans and strings.
    00009     *   They simplify conversions (mostly to string),
    00010     *   allow easy access to math/string functions and
    00011     *   implements new functions that are not present
    00012     *   in the standard libraries.<br>
    00013     *   <b>Note</b> : Most of Frost's base types are
    00014     *   slower than C++ base types. The difference is
    00015     *   negligible for small operations, but if you need
    00016     *   to do a lot of calculations it can bloat your
    00017     *   performances. Use prebuilt types in this case.<br>
    00018     *   <b>Note 2</b> : This class is almost as efficient
    00019     *   as the standard std::string.
    00020     */
    00021     template<class T>
    00022     class s_str_t
    00023     {
    00024     public :
    00025
    00026         typedef T                                 character;
    00027         typedef typename TypeTraits<T>::FrostType frost_character;
    00028         typedef typename std::basic_string<T>     string;
    00029         typedef typename string::iterator         iterator;
    00030         typedef typename string::const_iterator   const_iterator;
    00031         typedef s_range<iterator>                 range;
    00032         typedef s_range<const_iterator>           const_range;
    00033
    00034         /// Constructor.
    00035         s_str_t();
    00036
    00037         /// Copy constructor.
    00038         /** \param s The string to copy
    00039         */
    00040         s_str_t(const s_str_t& s);
    00041
    00042         /// Constructor.
    00043         /** \param s The string to copy
    00044         */
    00045         s_str_t(const string& s);
    00046
    00047         /// Constructor.
    00048         /** \param s The character array to copy
    00049         */
    00050         s_str_t(const character* s);
    00051
    00052         /// Constructor.
    00053         /** \param s The character array to copy
    00054         */
    00055         s_str_t(character* s);
    00056
    00057         /// Constructor.
    00058         /** \param c The character to copy
    00059         */
    00060         explicit s_str_t(const character& c);
    00061
    00062         /// Constructor.
    00063         /** \param c The character to copy
    00064         */
    00065         explicit s_str_t(const frost_character& c);
    00066
    00067         /// Creates "uiNbr" copies of the provided string.
    00068         /** \param s     The string to copy
    00069         *   \param uiNbr The number of times to copy the string
    00070         *   \note If uiNbr equals 0, creates an empty string.
    00071         */
    00072         s_str_t(const s_str_t& s, const s_uint_t<default_uint>& uiNbr);
    00073
    00074         /// Creates "uiNbr" copies of the provided character.
    00075         /** \param c     The character to copy
    00076         *   \param uiNbr The number of times to copy the character
    00077         *   \note If uiNbr equals 0, creates an empty string.
    00078         */
    00079         s_str_t(const character& c, const s_uint_t<default_uint>& uiNbr);
    00080
    00081         /// Creates "uiNbr" copies of the provided character.
    00082         /** \param c     The character to copy
    00083         *   \param uiNbr The number of times to copy the character
    00084         *   \note If uiNbr equals 0, creates an empty string.
    00085         */
    00086         s_str_t(const frost_character& c, const s_uint_t<default_uint>& uiNbr);
    00087
    00088         /// Generic constructor (only supports string -> string conversion).
    00089         /** \param mValue    The value to convert
    00090         *   \param mEnableIf Template trick to enable this constructor for convertible
    00091         *                    types only, don't bother with it
    00092         *   \note Calls StringConverter::Convert().
    00093         */
    00094         template<class N>
    00095         s_str_t(const N& mValue, typename StringConverter<character, N>::IsDefined* mEnableIf = 0)
    00096         {
    00097             sValue_ = StringConverter<character, N>::Construct(mValue);
    00098         }
    00099
    00100         /// Changes the case of the first character.
    00101         /** \param bCapitalStart If 'true', the first character will be
    00102         *                        capitalized.
    00103         */
    00104         void CapitalStart(const s_bool& bCapitalStart);
    00105
    00106         /// Removes the content of the string.
    00107         void Clear();
    00108
    00109         /// Cuts this string everytime the delineator is found.
    00110         /** \param sDelim            The delineator
    00111         *   \return A vector containing the separated strings
    00112         *   \note If the delineator is not found in the string, this function
    00113         *         returns the whole string, unchanged.
    00114         *   \note Removes the delineator from the sub-strings.<br>
    00115         *         This function <b>groups</b> occurences of the delineator.
    00116         */
    00117         s_ctnr<s_str_t> Cut(const s_str_t& sDelim) const;
    00118
    00119         /// Cuts this string everytime the delineator is found.
    00120         /** \param sDelim            The delineator
    00121         *   \param uiMaxCut          The maximum number of occurences.
    00122         *   \return A vector containing the separated strings
    00123         *   \note If the delineator is not found in the string, this function
    00124         *         returns the whole string, unchanged.
    00125         *   \note Removes the delineator from the sub-strings.<br>
    00126         *         This function <b>groups</b> occurences of the delineator.
    00127         */
    00128         s_ctnr<s_str_t> Cut(const s_str_t& sDelim, const s_uint_t<default_uint>& uiMaxCut) const;
    00129
    00130         /// Cuts this string everytime the delineator is found.
    00131         /** \param sDelim            The delineator
    00132         *   \return A vector containing the separated strings
    00133         *   \note If the delineator is not found in the string, this function
    00134         *         returns the whole string, unchanged.
    00135         *   \note Removes the delineator from the sub-strings.<br>
    00136         *         This function cuts the string <b>each time</b> the delineator
    00137         *         is found.
    00138         */
    00139         s_ctnr<s_str_t> CutEach(const s_str_t& sDelim) const;
    00140
    00141         /// Cuts this string everytime the delineator is found.
    00142         /** \param sDelim            The delineator
    00143         *   \param uiMaxCut          The maximum number of occurences.
    00144         *   \return A vector containing the separated strings
    00145         *   \note If the delineator is not found in the string, this function
    00146         *         returns the whole string, unchanged.
    00147         *   \note Removes the delineator from the sub-strings.<br>
    00148         *         This function cuts the string <b>each time</b> the delineator
    00149         *         is found.
    00150         */
    00151         s_ctnr<s_str_t> CutEach(const s_str_t& sDelim, const s_uint_t<default_uint>& uiMaxCut) const;
    00152
    00153         /// Cuts this string everytime a delineator is found.
    00154         /** \param lDelims The list of delineators (single characters)
    00155         *   \return A vector containing the separated strings
    00156         *   \note If no delineator is found in the string, this function
    00157         *         returns the whole string, unchanged.
    00158         *   \note Removes delineators from the sub-strings.<br>
    00159         *         This function <b>groups</b> occurences of any delineator.
    00160         *         Unlike the other versions, this function only supports
    00161         *         cutting by *single* characters.
    00162         */
    00163         s_ctnr<s_str_t> Cut(const s_ctnr<character>& lDelims) const;
    00164
    00165         /// Counts the number of time a certain pattern is found on the string.
    00166         /** \param sPattern The string to search for
    00167         *   \return The number of time this pattern is found
    00168         */
    00169         s_uint_t<default_uint> CountOccurences(const s_str_t& sPattern) const;
    00170
    00171         /// Removes a certain number of character from a given position.
    00172         /** \param uiStart From where to start erasing
    00173         *   \param uiNbr   The number of character to erase
    00174         */
    00175         void Erase(const s_uint_t<default_uint>& uiStart, const s_uint_t<default_uint>& uiNbr);
    00176
    00177         /// Removes a character.
    00178         /** \param uiPos The character to erase
    00179         */
    00180         void Erase(const s_uint_t<default_uint>& uiPos);
    00181
    00182         /// Removes a character.
    00183         /** \param iter An iterator pointing at the caracter to erase
    00184         */
    00185         iterator Erase(iterator iter);
    00186
    00187         /// Removes a certain number of character from the end of the string.
    00188         /** \param uiNbr The number of character to erase
    00189         */
    00190         void EraseFromEnd(const s_uint_t<default_uint>& uiNbr);
    00191
    00192         /// Removes a certain number of character from the beginning of the string.
    00193         /** \param uiNbr The number of character to erase
    00194         */
    00195         void EraseFromStart(const s_uint_t<default_uint>& uiNbr);
    00196
    00197         /// Removes all characters between the provided positions.
    00198         /** \param uiStart From where to start erasing
    00199         *   \param uiEnd   From where to end (exclusive)
    00200         */
    00201         void EraseRange(const s_uint_t<default_uint>& uiStart, const s_uint_t<default_uint>& uiEnd);
    00202
    00203         /// Removes all characters between the provided positions.
    00204         /** \param iterStart From where to start erasing
    00205         *   \param iterEnd   From where to end (exclusive)
    00206         */
    00207         iterator EraseRange(iterator iterStart, iterator iterEnd);
    00208
    00209         /// Removes all characters between the provided positions.
    00210         /** \param mRange The range to erase
    00211         */
    00212         iterator EraseRange(range mRange);
    00213
    00214         /// Returns a certain number of character from a given position.
    00215         /** \param uiStart From where to start reading
    00216         *   \param uiNbr   The number of character to read
    00217         *   \return The resulting string
    00218         */
    00219         s_str_t Extract(const s_uint_t<default_uint>& uiStart, const s_uint_t<default_uint>& uiNbr = s_uint_t<default_uint>::INF) const;
    00220
    00221         /// Returns all characters between the provided positions.
    00222         /** \param uiStart From where to start reading
    00223         *   \param uiEnd   From where to end (exclusive)
    00224         *   \return The resulting string
    00225         */
    00226         s_str_t ExtractRange(const s_uint_t<default_uint>& uiStart, const s_uint_t<default_uint>& uiEnd) const;
    00227
    00228         /// Returns the position of the pattern in the string.
    00229         /** \param sValue  The string to search for
    00230         *   \return An iterator pointing at the pattern (End() if not found)
    00231         */
    00232         iterator Get(const s_str_t& sValue);
    00233
    00234         /// Returns the position of the pattern in the string.
    00235         /** \param sValue  The string to search for
    00236         *   \param uiStart From where to start searching
    00237         *   \return An iterator pointing at the pattern (End() if not found)
    00238         */
    00239         iterator Get(const s_str_t& sValue, const s_uint_t<default_uint>& uiStart);
    00240
    00241         /// Returns the position of the pattern in the string.
    00242         /** \param sValue  The string to search for
    00243         *   \return The position of the pattern (NaN if not found)
    00244         */
    00245         const_iterator Get(const s_str_t& sValue) const;
    00246
    00247         /// Returns the position of the pattern in the string.
    00248         /** \param sValue  The string to search for
    00249         *   \param uiStart From where to start searching
    00250         *   \return The position of the pattern (NaN if not found)
    00251         */
    00252         const_iterator Get(const s_str_t& sValue, const s_uint_t<default_uint>& uiStart) const;
    00253
    00254         /// Returns the position of the pattern in the string.
    00255         /** \param sValue  The string to search for
    00256         *   \return The position of the pattern (NaN if not found)
    00257         */
    00258         s_uint_t<default_uint> FindPos(const s_str_t& sValue) const;
    00259
    00260         /// Returns the position of the pattern in the string.
    00261         /** \param sValue  The string to search for
    00262         *   \param uiStart From where to start searching
    00263         *   \return The position of the pattern (NaN if not found)
    00264         */
    00265         s_uint_t<default_uint> FindPos(const s_str_t& sValue, const s_uint_t<default_uint>& uiStart) const;
    00266
    00267         /// Returns all positions of the pattern in the string.
    00268         /** \param sPattern The string to search for
    00269         *   \return All positions of the pattern (empty if not found)
    00270         */
    00271         s_ctnr< s_uint_t<default_uint> > FindAllPos(const s_str_t& sPattern);
    00272
    00273         /// Returns all positions of the pattern in the string.
    00274         /** \param sPattern The string to search for
    00275         *   \param uiStart  From where to start searching
    00276         *   \return All positions of the pattern (empty if not found)
    00277         */
    00278         s_ctnr< s_uint_t<default_uint> > FindAllPos(const s_str_t& sPattern, const s_uint_t<default_uint>& uiStart);
    00279
    00280         /// Returns true is the pattern is found in the string.
    00281         /** \param sValue  The string to search for
    00282         *   \return 'true' if the  pattern is found
    00283         */
    00284         s_bool Find(const s_str_t& sValue) const;
    00285
    00286         /// Returns true is the pattern is found in the string.
    00287         /** \param sValue  The string to search for
    00288         *   \param uiStart From where to start searching
    00289         *   \return 'true' if the  pattern is found
    00290         */
    00291         s_bool Find(const s_str_t& sValue, const s_uint_t<default_uint>& uiStart) const;
    00292
    00293         /// Returns a const reference to the string.
    00294         /** \return A const reference to the string
    00295         */
    00296         inline const string& Get() const { return sValue_; }
    00297
    00298         /// Returns a reference to the string.
    00299         /** \return A reference to the string
    00300         */
    00301         inline string& Get() { return sValue_; }
    00302
    00303         /// Returns a C-style string.
    00304         /** \return A C-style string
    00305         */
    00306         inline const T* c_str() const { return sValue_.c_str(); }
    00307
    00308         /// Checks if the string is empty.
    00309         /** \param bIgnoreSpaces Set to 'true' if you want a string to be reported as
    00310         *                        empty if it only contains white spaces and or tabs
    00311         *   \return 'true' if the string doesn't contain any character
    00312         */
    00313         s_bool IsEmpty(const s_bool& bIgnoreSpaces = false) const;
    00314
    00315         /// Checks if the string is a number.
    00316         /** \return 'true' if the string is a number
    00317         */
    00318         s_bool IsNumber() const;
    00319
    00320         /// Checks if the string is a bool.
    00321         /** \return 'true' if the string is a bool
    00322         */
    00323         s_bool IsBoolean() const;
    00324
    00325         /// Returns the number of character in the string.
    00326         /** \return The number of character in the string
    00327         */
    00328         s_uint_t<default_uint> GetLength() const;
    00329
    00330         /// Returns the number of character in ths string.
    00331         /** \return The number of character in the string
    00332         */
    00333         s_uint_t<default_uint> GetSize() const;
    00334
    00335         /// Makes this string completely lower case.
    00336         void ToLower();
    00337
    00338         /// Makes this string completely UPPER CASE.
    00339         void ToUpper();
    00340
    00341         /// Removes the surrounding characters matching the provided pattern.
    00342         /** \param cPattern The character to remove
    00343         *   \return The number of character erased
    00344         */
    00345         s_uint_t<default_uint> Trim(const character& cPattern);
    00346
    00347         /// Replaces a pattern by another string.
    00348         /** \param sPattern     The string to search for
    00349         *   \param sReplacement The string that will replace it
    00350         *   \return The number of replacement
    00351         */
    00352         s_uint_t<default_uint> Replace(const s_str_t& sPattern, const s_str_t& sReplacement);
    00353
    00354         /// Adds a new character at the end of the string.
    00355         /** \param cChar The character to add
    00356         */
    00357         void PushBack(const character& cChar);
    00358
    00359         /// Adds a new string at the end of this string.
    00360         /** \param sValue The string to add
    00361         */
    00362         void PushBack(const s_str_t& sValue);
    00363
    00364         /// Removes the last character.
    00365         void PopBack();
    00366
    00367         /// Returns a reference to the last character.
    00368         /** \return A reference to the last character
    00369         */
    00370         T& Back();
    00371
    00372         /// Returns a const reference to the last character.
    00373         /** \return A const reference to the last character
    00374         */
    00375         const T& Back() const;
    00376
    00377         /// Adds a new character at the beginning of the string.
    00378         /** \param cChar The character to add
    00379         */
    00380         void PushFront(const character& cChar);
    00381
    00382         /// Adds a new string at the beginning of this string.
    00383         /** \param sValue The string to add
    00384         */
    00385         void PushFront(const s_str_t& sValue);
    00386
    00387         /// Removes the first character.
    00388         void PopFront();
    00389
    00390         /// Returns a reference to the first character.
    00391         /** \return A reference to the first character
    00392         */
    00393         T& Front();
    00394
    00395         /// Returns a const reference to the first character.
    00396         /** \return A const reference to the first character
    00397         */
    00398         const T& Front() const;
    00399
    00400         /// Adds a new character somewhere in the string.
    00401         /** \param cChar The character to add
    00402         *   \param uiPos The position at which to insert the char
    00403         */
    00404         void Insert(const character& cChar, const s_uint_t<default_uint>& uiPos);
    00405
    00406         /// Adds a new character somewhere in the string.
    00407         /** \param cChar The character to add
    00408         *   \param iter  The position at which to insert the char
    00409         *   \return An iterator pointing after the inserted char
    00410         */
    00411         iterator Insert(const character& cChar, iterator iter);
    00412
    00413         /// Adds another string somewhere in this string.
    00414         /** \param sValue The string to insert
    00415         *   \param uiPos The position at which to insert the char
    00416         */
    00417         void Insert(const s_str_t& sValue, const s_uint_t<default_uint>& uiPos);
    00418
    00419         /// Adds another string somewhere in this string.
    00420         /** \param sValue The string to insert
    00421         *   \param iter   The position at which to insert the string
    00422         *   \return An iterator pointing at the end of the inserted string
    00423         */
    00424         iterator Insert(const s_str_t& sValue, iterator iter);
    00425
    00426         /// Inverts the order of the letters in the string.
    00427         void Reverse();
    00428
    00429         /// Checks if this string starts with the provided pattern.
    00430         /** \param sPattern The pattern to search for
    00431         *   \return 'true' if the pattern has been found
    00432         */
    00433         s_bool StartsWith(const s_str_t& sPattern) const;
    00434
    00435         /// Checks if this string ends with the provided pattern.
    00436         /** \param sPattern The pattern to search for
    00437         *   \return 'true' if the pattern has been found
    00438         */
    00439         s_bool EndsWith(const s_str_t& sPattern) const;
    00440
    00441         iterator begin();
    00442         const_iterator begin() const;
    00443
    00444         iterator end();
    00445         const_iterator end() const;
    00446
    00447         iterator Begin();
    00448         const_iterator Begin() const;
    00449
    00450         iterator End();
    00451         const_iterator End() const;
    00452
    00453         T& operator [] (const s_uint_t<default_uint>& uiIndex);
    00454         const T& operator [] (const s_uint_t<default_uint>& uiIndex) const;
    00455         T& operator [] (const default_uint& uiIndex);
    00456         const T& operator [] (const default_uint& uiIndex) const;
    00457
    00458         template<class N>
    00459         s_str_t operator + (const N& mValue) const
    00460         {
    00461             return sValue_ + StringConverter<T, N>::Convert(mValue);
    00462         }
    00463
    00464         template<class N>
    00465         void operator += (const N& mValue)
    00466         {
    00467             sValue_ += StringConverter<T, N>::Convert(mValue);
    00468         }
    00469
    00470         template<class N>
    00471         s_str_t& operator << (const N& mValue)
    00472         {
    00473             sValue_ += StringConverter<T, N>::Convert(mValue);
    00474             return *this;
    00475         }
    00476
    00477         s_bool operator == (const s_str_t& mValue) const;
    00478
    00479         s_bool operator != (const s_str_t& mValue) const;
    00480
    00481         s_bool operator < (const s_str_t& mValue) const;
    00482
    00483         s_bool operator > (const s_str_t& mValue) const;
    00484
    00485         s_bool operator <= (const s_str_t& mValue) const;
    00486
    00487         s_bool operator >= (const s_str_t& mValue) const;
    00488
    00489         static const s_str_t EMPTY;
    00490
    00491         /// Makes the provided string lower case.
    00492         /** \param sValue The string to modify
    00493         *   \return The lower cased string
    00494         */
    00495         static s_str_t ToLower(const s_str_t& sValue);
    00496
    00497         /// Makes the provided string UPPER CASE.
    00498         /** \param sValue The string to modify
    00499         *   \return The upper cased string
    00500         */
    00501         static s_str_t ToUpper(const s_str_t& sValue);
    00502
    00503         /// Reverses the provided string.
    00504         /** \param sValue The string to reverse
    00505         *   \return The reversed string
    00506         */
    00507         static s_str_t Reverse(const s_str_t& sValue);
    00508
    00509         /// Generic conversion function.
    00510         /** \param mValue The value to convert
    00511         *   \note Calls StringConverter::Convert().
    00512         */
    00513         template<class N>
    00514         static s_str_t Convert(const N& mValue)
    00515         {
    00516             return StringConverter<T, N>::Convert(mValue);
    00517         }
    00518
    00519         /// Generic conversion function.
    00520         /** \param mValue  The value to convert
    00521         *   \param mParam1 The first parameter
    00522         */
    00523         template<class N, class M>
    00524         static s_str_t Convert(const N& mValue, const M& mParam1)
    00525         {
    00526             return StringConverter<T, N>::Convert(mValue, mParam1);
    00527         }
    00528
    00529         /// Generic conversion function.
    00530         /** \param mValue  The value to convert
    00531         *   \param mParam1 The first parameter
    00532         *   \param mParam2 The second parameter
    00533         */
    00534         template<class N, class M, class O>
    00535         static s_str_t Convert(const N& mValue, const M& mParam1, const O& mParam2)
    00536         {
    00537             return StringConverter<T, N>::Convert(mValue, mParam1, mParam2);
    00538         }
    00539
    00540         /// Checks if the provided character is a number.
    00541         /** \param cValue The character to test
    00542         *   \return 'true' if the provided character is a number
    00543         */
    00544         static s_bool IsNumber(const character& cValue);
    00545
    00546         /// Checks if the provided character is a number.
    00547         /** \param cValue The character to test
    00548         *   \return 'true' if the provided character is a number
    00549         */
    00550         static s_bool IsNumber(const frost_character& cValue);
    00551
    00552         /// Checks if the provided character is a letter or a number.
    00553         /** \param cValue The character to test
    00554         *   \return 'true' if the provided character is a letter or a number
    00555         */
    00556         static s_bool IsAlphaNumeric(const character& cValue);
    00557
    00558         /// Checks if the provided character is a letter or a number.
    00559         /** \param cValue The character to test
    00560         *   \return 'true' if the provided character is a letter or a number
    00561         */
    00562         static s_bool IsAlphaNumeric(const frost_character& cValue);
    00563
    00564     private :
    00565
    00566         string sValue_;
    00567
    00568     };
    00569
    00570     template<class T, class N>
    00571     s_str_t<T> operator + (const T* sLeft, const s_str_t<N>& sRight)
    00572     {
    00573         return s_str_t<T>(sLeft) + s_str_t<T>::Convert(sRight);
    00574     }
    00575
    00576     template<class T, class N>
    00577     s_str_t<T> operator + (const T* sLeft, const N& mRight)
    00578     {
    00579         return s_str_t<T>(sLeft) + s_str_t<T>::Convert(mRight);
    00580     }
    00581
    00582     template<class T, class N>
    00583     s_str_t<T> operator + (const N& mLeft, const T* sRight)
    00584     {
    00585         return s_str_t<T>::Convert(mLeft) + s_str_t<T>(sRight);
    00586     }
    00587
    00588     /*template<class T, class N>
    00589     s_str_t<T> operator + (const std::basic_string<T> sLeft, const N& mRight)
    00590     {
    00591         return s_str_t<T>(sLeft) + s_str_t<T>::Convert(mRight);
    00592     }
    00593     template<class T, class N>
    00594     s_str_t<T> operator + (const N& mLeft, const std::basic_string<T> sRight)
    00595     {
    00596         return s_str_t<T>::Convert(mLeft) + s_str_t<T>(sRight);
    00597     }
    00598     */
    00599
    00600     template<class T, class N>
    00601     s_str_t<T> operator + (const N& mLeft, const s_str_t<T>& sRight)
    00602     {
    00603         s_str_t<T> s = s_str_t<T>::Convert(mLeft);
    00604         s.PushBack(sRight);
    00605         return s;
    00606     }
    00607
    00608     /** \cond NOT_REMOVE_FROM_DOC
    00609     */
    00610     template<> class TypeTraits<s_str_t<string_element>::string>
    00611     {
    00612     public :
    00613
    00614         typedef s_str_t<string_element>::string string_object;
    00615
    00616         typedef string_object           Type;
    00617         typedef string_object           BaseType;
    00618         typedef s_str_t<string_element> FrostType;
    00619         typedef string_element          CharType;
    00620         typedef string_object&          RefType;
    00621         typedef const string_object&    CRefType;
    00622         typedef string_object*          PointerType;
    00623
    00624         static inline RefType  GetValue(RefType m)  { return m; }
    00625         static inline CRefType GetValue(CRefType m) { return m; }
    00626     };
    00627     template<> class TypeTraits<const string_element*>
    00628     {
    00629     public :
    00630         typedef const string_element*          Type;
    00631         typedef const string_element*          BaseType;
    00632         typedef s_str_t<string_element>        FrostType;
    00633         typedef string_element                 CharType;
    00634         typedef const string_element*&         RefType;
    00635         typedef string_element const * const & CRefType;
    00636         typedef const string_element**         PointerType;
    00637
    00638         static inline RefType  GetValue(RefType m)  { return m; }
    00639         static inline CRefType GetValue(CRefType m) { return m; }
    00640     };
    00641     template<> class TypeTraits<string_element*>
    00642     {
    00643     public :
    00644         typedef string_element*          Type;
    00645         typedef string_element*          BaseType;
    00646         typedef s_str_t<string_element>  FrostType;
    00647         typedef string_element           CharType;
    00648         typedef string_element*&         RefType;
    00649         typedef string_element * const & CRefType;
    00650         typedef string_element**         PointerType;
    00651
    00652         static inline RefType  GetValue(RefType m)  { return m; }
    00653         static inline CRefType GetValue(CRefType m) { return m; }
    00654     };
    00655     template<int N> class TypeTraits<const string_element[N]>
    00656     {
    00657     public :
    00658         typedef const string_element*          Type;
    00659         typedef const string_element*          BaseType;
    00660         typedef s_str_t<string_element>        FrostType;
    00661         typedef string_element                 CharType;
    00662         typedef const string_element*&         RefType;
    00663         typedef string_element const * const & CRefType;
    00664         typedef const string_element**         PointerType;
    00665
    00666         static inline RefType  GetValue(RefType m)  { return m; }
    00667         static inline CRefType GetValue(CRefType m) { return m; }
    00668     };
    00669     template<int N> class TypeTraits<string_element[N]>
    00670     {
    00671     public :
    00672         typedef string_element*         Type;
    00673         typedef string_element*         BaseType;
    00674         typedef s_str_t<string_element> FrostType;
    00675         typedef string_element          CharType;
    00676         typedef string_element*&        RefType;
    00677         typedef string_element* const & CRefType;
    00678         typedef string_element**        PointerType;
    00679
    00680         static inline RefType  GetValue(RefType m)  { return m; }
    00681         static inline CRefType GetValue(CRefType m) { return m; }
    00682     };
    00683
    00684     template<> class TypeTraits< std::basic_string<uint> >
    00685     {
    00686     public :
    00687         typedef std::basic_string<uint>        Type;
    00688         typedef std::basic_string<uint>        BaseType;
    00689         typedef s_str_t<uint>                  FrostType;
    00690         typedef uint                           CharType;
    00691         typedef std::basic_string<uint>&       RefType;
    00692         typedef const std::basic_string<uint>& CRefType;
    00693         typedef std::basic_string<uint>*       PointerType;
    00694
    00695         static inline RefType  GetValue(RefType m)  { return m; }
    00696         static inline CRefType GetValue(CRefType m) { return m; }
    00697     };
    00698     template<> class TypeTraits<const uint*>
    00699     {
    00700     public :
    00701         typedef const uint*          Type;
    00702         typedef const uint*          BaseType;
    00703         typedef s_str_t<uint>        FrostType;
    00704         typedef uint                 CharType;
    00705         typedef const uint*&         RefType;
    00706         typedef uint const * const & CRefType;
    00707         typedef const uint**         PointerType;
    00708
    00709         static inline RefType  GetValue(RefType m)  { return m; }
    00710         static inline CRefType GetValue(CRefType m) { return m; }
    00711     };
    00712     template<> class TypeTraits<uint*>
    00713     {
    00714     public :
    00715         typedef uint*          Type;
    00716         typedef uint*          BaseType;
    00717         typedef s_str_t<uint>  FrostType;
    00718         typedef uint           CharType;
    00719         typedef uint*&         RefType;
    00720         typedef uint * const & CRefType;
    00721         typedef uint**         PointerType;
    00722
    00723         static inline RefType  GetValue(RefType m)  { return m; }
    00724         static inline CRefType GetValue(CRefType m) { return m; }
    00725     };
    00726     template<int N> class TypeTraits<const uint[N]>
    00727     {
    00728     public :
    00729         typedef const uint*          Type;
    00730         typedef const uint*          BaseType;
    00731         typedef s_str_t<uint>        FrostType;
    00732         typedef uint                 CharType;
    00733         typedef const uint*&         RefType;
    00734         typedef uint const * const & CRefType;
    00735         typedef const uint**         PointerType;
    00736
    00737         static inline RefType  GetValue(RefType m)  { return m; }
    00738         static inline CRefType GetValue(CRefType m) { return m; }
    00739     };
    00740     template<int N> class TypeTraits<uint[N]>
    00741     {
    00742     public :
    00743         typedef uint*         Type;
    00744         typedef uint*         BaseType;
    00745         typedef s_str_t<uint> FrostType;
    00746         typedef uint          CharType;
    00747         typedef uint*&        RefType;
    00748         typedef uint* const & CRefType;
    00749         typedef uint**        PointerType;
    00750
    00751         static inline RefType  GetValue(RefType m)  { return m; }
    00752         static inline CRefType GetValue(CRefType m) { return m; }
    00753     };
    00754
    00755     template<class T> class TypeTraits< s_str_t<T> >
    00756     {
    00757     public :
    00758         typedef s_str_t<T>           Type;
    00759         typedef std::basic_string<T> BaseType;
    00760         typedef s_str_t<T>           FrostType;
    00761         typedef T                    CharType;
    00762         typedef s_str_t<T>&          RefType;
    00763         typedef const s_str_t<T>&    CRefType;
    00764         typedef s_str_t<T>*          PointerType;
    00765
    00766         static inline typename TypeTraits<BaseType>::RefType  GetValue(RefType m)  { return m.Get(); }
    00767         static inline typename TypeTraits<BaseType>::CRefType GetValue(CRefType m) { return m.Get(); }
    00768     };
    00769     /** \endcond
    00770     */
    00771 }