activemq-cpp-3.3.0

src/main/decaf/lang/String.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef _DECAF_LANG_STRING_H_
00019 #define _DECAF_LANG_STRING_H_
00020 
00021 #include <decaf/util/Config.h>
00022 
00023 #include <decaf/lang/CharSequence.h>
00024 #include <decaf/lang/Comparable.h>
00025 
00026 #include <string>
00027 
00028 namespace decaf {
00029 namespace lang {
00030 
00031     class Contents;
00032 
00038     class DECAF_API String : public CharSequence {
00039     private:
00040 
00041         Contents* contents;
00042 
00043     public:  // Constructors
00044 
00048         String();
00049 
00056         String( const String& source );
00057 
00064         String( const std::string& source );
00065 
00080         String( const char* array, int size );
00081 
00101         String( const char* array, int size, int offset, int length );
00102 
00103         virtual ~String();
00104 
00105     public:
00106 
00107         // TODO
00108         String& operator= ( const String& );
00109         String& operator= ( const std::string& );
00110 
00111     public:  // String API
00112 
00116         bool isEmpty() const;
00117 
00118     public:  // CharSequence Implementation
00119 
00123         virtual int length() const;
00124 
00128         virtual char charAt( int index ) const;
00129 
00133         virtual CharSequence* subSequence( int start, int end ) const;
00134 
00138         virtual std::string toString() const;
00139 
00140     public:  // Static methods.
00141 
00150         static String valueOf(bool value);
00151 
00160         static String valueOf(char value);
00161 
00170         static String valueOf(float value);
00171 
00180         static String valueOf(double value);
00181 
00190         static String valueOf(short value);
00191 
00200         static String valueOf(int value);
00201 
00210         static String valueOf(long long value);
00211 
00212     };
00213 
00214 }}
00215 
00216 #endif /* _DECAF_LANG_STRING_H_ */