summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/String.h
blob: 6d0ec3a55403e140d1df8734b8a0cbb793560f03 (plain)
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
70
71
72
73
74
75
#ifndef __ASURA_ENGINE_STRING_H__
#define __ASURA_ENGINE_STRING_H__

#include <string>

namespace AsuraEngine
{

    ///
    /// װstd::string
    ///
    class String : public std::string
    {
    public:
        inline String()
            : std::string()
        {
        }

        inline String(const std::string& str)
            : std::string(str)
        {
        }

        inline String(const String& str)
            : std::string(str)
        {
        }

        inline String(const char* str)
            : std::string(str)
        {
        }

        inline String& operator = (const String& str)
        {
            std::string::operator=(str);
            return *this;
        }

        inline operator const char* () const
        {
            return this->c_str();
        }

        inline const char* str() const
        {
            return this->c_str();
        }

        inline String(const String& s2, size_type pos2, size_type len2)
            : std::string(s2, pos2, len2)
        {
        }

        inline String(const char* buf, size_type bufsize)
            : std::string(buf, bufsize)
        {
        }

        inline String(size_type repetitions, char c)
            : std::string(repetitions, c)
        {
        }

        inline int length() const
        {
            return size();
        }

    };

}

#endif