00001 /* 00002 * WOscLib, an object oriented OSC library. 00003 * Copyright (C) 2005 Uli Clemens Franke, Weiss Engineering LTD, Switzerland. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 * 00019 * For details see lgpl.txt 00020 * 00021 * Weiss Engineering LTD. 00022 * Florastrass 42 00023 * 8610 Uster 00024 * Switzerland 00025 * 00026 * uli.franke@weiss.ch 00027 */ 00028 00029 /** WOscString header file. 00030 * \file 00031 * 00032 * $Author: cls-nebadje $ ( \ref _UcfWOscLib ) 00033 * $Date: 2006-05-16 21:21:41 $ 00034 * $Revision: 1.3 $ 00035 * 00036 * Copyright (c) Weiss Engineering Ltd 00037 * 00038 */ 00039 #ifndef __WOSCSTRING_H__ 00040 #define __WOSCSTRING_H__ 00041 00042 #include "WOscLib.h" 00043 00044 00045 /** Wrapping of OSC specific strings (4-byte aligned). 00046 * OSC-strings must be 4-byte aligned. The interface 00047 * of this class guarantees the 4-byte-alignment. 00048 * 00049 * \remarks 00050 * None. 00051 */ 00052 class WOSC_EXPORT WOscString{ 00053 public: 00054 WOscString(const char* string = ""); 00055 WOscString(const WOscString& rhs); 00056 ~WOscString(); 00057 00058 /* assignment operators */ 00059 WOscString& operator= (const char rhs); 00060 WOscString& operator= (const char* rhs); 00061 WOscString& operator= (const WOscString& rhs); 00062 WOscString operator+ (const WOscString& rhs); 00063 WOscString& operator+= (const char rhs); 00064 WOscString& operator+= (const char* rhs); 00065 WOscString& operator+= (const WOscString& rhs); 00066 00067 /* logical operators */ 00068 bool operator == (const WOscString& rhs) const ; 00069 bool operator != (const WOscString& rhs) const ; 00070 bool operator == (const char* str) const ; 00071 bool operator != (const char* str) const ; 00072 00073 operator const char*() const; 00074 00075 int GetSize(); 00076 void GetBuffer(char* buffer, int bufferLen); 00077 const char* GetBuffer() const; 00078 00079 private: 00080 char* m_buffer; /**< Internal zero padded data buffer.*/ 00081 int m_bufferLen; /**< Internal zero padded buffer length.*/ 00082 00083 }; 00084 00085 #endif // #ifndef __WOSCSTRING_H__