00001 /**************************************************************************** 00002 This file is part of ChainLink 00003 Copyright (C) 2007 Jeremy Magland (Jeremy.Magland@gmail.com) 00004 00005 ChainLink is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 ChainLink 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 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with ChainLink; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 *****************************************************************************/ 00020 00021 #ifndef CHAINLINK_STRING_H 00022 #define CHAINLINK_STRING_H 00023 00024 #include <stdlib.h> 00025 #include <stdio.h> 00026 #include <string.h> 00027 00030 class string { 00031 public: 00032 /* Pointer to string data. 00033 * 00034 * You may modify this data, but don't extend the length of the string (e.g. using strcat). 00035 * Use the set() method instead. 00036 */ 00037 char *data; 00038 string(); 00039 string(const string &X); 00040 string(const char *data_in); 00041 virtual ~string(); 00044 void allocate(int length); 00047 void set(const char *data_in); 00048 void operator=(const char *data_in); 00049 void operator=(const string &X); 00052 string operator+(const string &X); 00053 }; 00054 00055 00056 #endif 00057