activemq-cpp-3.8.2
String.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_LANG_STRING_H_
19 #define _DECAF_LANG_STRING_H_
20 
21 #include <decaf/util/Config.h>
22 
24 #include <decaf/lang/Comparable.h>
25 
26 #include <string>
27 
28 namespace decaf {
29 namespace lang {
30 
31  class Contents;
32 
38  class DECAF_API String : public CharSequence {
39  private:
40 
41  Contents* contents;
42 
43  public: // Constructors
44 
48  String();
49 
56  String( const String& source );
57 
64  String( const std::string& source );
65 
80  String( const char* array, int size );
81 
101  String( const char* array, int size, int offset, int length );
102 
103  virtual ~String();
104 
105  public:
106 
107  // TODO
108  String& operator= ( const String& );
109  String& operator= ( const std::string& );
110 
111  public: // String API
112 
116  bool isEmpty() const;
117 
118  public: // CharSequence Implementation
119 
123  virtual int length() const;
124 
128  virtual char charAt( int index ) const;
129 
133  virtual CharSequence* subSequence( int start, int end ) const;
134 
138  virtual std::string toString() const;
139 
140  public: // Static methods.
141 
150  static String valueOf(bool value);
151 
160  static String valueOf(char value);
161 
170  static String valueOf(float value);
171 
180  static String valueOf(double value);
181 
190  static String valueOf(short value);
191 
200  static String valueOf(int value);
201 
210  static String valueOf(long long value);
211 
212  };
213 
214 }}
215 
216 #endif /* _DECAF_LANG_STRING_H_ */
A CharSequence is a readable sequence of char values.
Definition: CharSequence.h:36
The String class represents an immutable sequence of chars.
Definition: String.h:38
#define DECAF_API
Definition: Config.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25