summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Containers/String.h
blob: 3c806fb1c2e313b1d3f4807d595e9365d280bdb0 (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
76
77
78
#ifndef __AE_STRING_H__
#define __AE_STRING_H__

#include <string>

namespace AsuraEngine
{
    namespace Containers
    {

        ///
        /// װ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