RTP Audio System  2.0.0
tdstrings.h
Go to the documentation of this file.
00001 /*
00002  *  $Id: tdstrings.h 1259 2011-12-17 13:26:09Z dreibh $
00003  *
00004  * SocketAPI implementation for the sctplib.
00005  * Copyright (C) 1999-2012 by Thomas Dreibholz
00006  *
00007  * Realized in co-operation between
00008  * - Siemens AG
00009  * - University of Essen, Institute of Computer Networking Technology
00010  * - University of Applied Sciences, Muenster
00011  *
00012  * Acknowledgement
00013  * This work was partially funded by the Bundesministerium fuer Bildung und
00014  * Forschung (BMBF) of the Federal Republic of Germany (Foerderkennzeichen 01AK045).
00015  * The authors alone are responsible for the contents.
00016  *
00017  * This program is free software: you can redistribute it and/or modify
00018  * it under the terms of the GNU General Public License as published by
00019  * the Free Software Foundation, either version 3 of the License, or
00020  * (at your option) any later version.
00021 
00022  * This program is distributed in the hope that it will be useful,
00023  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  * GNU General Public License for more details.
00026  *
00027  * You should have received a copy of the GNU General Public License
00028  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00029  *
00030  * Contact: discussion@sctp.de
00031  *          dreibh@iem.uni-due.de
00032  *          tuexen@fh-muenster.de
00033  *
00034  * Purpose: Strings Implementation
00035  *
00036  */
00037 
00038 
00039 #ifndef TDSTRINGS_H
00040 #define TDSTRINGS_H
00041 
00042 
00043 #include "tdsystem.h"
00044 
00045 
00053 class String
00054 {
00055    // ====== Constructors/destructor ========================================
00056    public:
00060    String();
00061 
00067    String(const String& string);
00068 
00074    String(const char* string);
00075 
00082    String(const char* string, const cardinal length);
00083 
00089    String(const cardinal value);
00090 
00094    ~String();
00095 
00096 
00097    // ====== String functions ===============================================
00103    inline const char* getData() const;
00104 
00110    inline cardinal length() const;
00111 
00117    inline bool isNull() const;
00118 
00125    inline integer index(const char c) const;
00126 
00133    inline integer rindex(const char c) const;
00134 
00141    inline integer find(const String& string) const;
00142 
00148    String toUpper() const;
00149 
00155    String toLower() const;
00156 
00163    String left(const cardinal maxChars) const;
00164 
00172    String mid(const cardinal start, const cardinal maxChars) const;
00173 
00180    inline String mid(const cardinal start) const;
00181 
00188    String right(const cardinal maxChars) const;
00189 
00190 
00196    String stripWhiteSpace() const;
00197 
00198 
00209    bool scanSetting(String& s1, String& s2) const;
00210 
00211 
00212    // ====== Operators ======================================================
00216    String& operator=(const String& string);
00217 
00221    String& operator=(const char* string);
00222 
00226    String& operator=(const cardinal value);
00227 
00231    inline int operator==(const String& string) const;
00232 
00236    inline int operator!=(const String& string) const;
00237 
00241    inline int operator<(const String& string) const;
00242 
00246    inline int operator<=(const String& string) const;
00247 
00251    inline int operator>(const String& string) const;
00252 
00256    inline int operator>=(const String& string) const;
00257 
00261    inline char operator[](const int index) const;
00262 
00263 
00270    inline static cardinal stringLength(const char* string);
00271 
00279    inline static integer stringCompare(const char* str1, const char* str2);
00280 
00288    inline static char* stringDuplicate(const char* string);
00289 
00290 
00291    // ====== Private data ===================================================
00292    private:
00293    inline void setData(char* string);
00294 
00295 
00296    char* Data;
00297 };
00298 
00299 
00300 // ====== Operators =========================================================
00304 std::ostream& operator<<(std::ostream& out, const String& string);
00305 
00309 String operator+(const String& string1, const String& string2);
00310 
00311 
00312 #include "tdstrings.icc"
00313 
00314 
00315 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines