Changeset 1163:030601407a72
- Timestamp:
- 02/22/09 15:14:50 (3 years ago)
- Branch:
- libdodo
- Location:
- trunk
- Files:
-
- 5 edited
- 5 moved
-
Makefile.in (modified) (1 diff)
-
configure (modified) (2 diffs)
-
configure.in (modified) (1 diff)
-
include/libdodo/exceptionBasic.h (modified) (1 diff)
-
include/libdodo/ioMemory.h (moved) (moved from trunk/include/libdodo/ioString.h) (11 diffs)
-
include/libdodo/ioMemoryEx.h (moved) (moved from trunk/include/libdodo/ioStringEx.h) (4 diffs)
-
include/libdodo/xexec.h (modified) (1 diff)
-
src/ioMemory.cc (moved) (moved from trunk/src/ioString.cc) (17 diffs)
-
tests/iomemory_test/Makefile.in (moved) (moved from trunk/tests/iostring_test/Makefile.in)
-
tests/iomemory_test/test.cc (moved) (moved from trunk/tests/iostring_test/test.cc) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r1161 r1163 59 59 ioNetworkServer.o \ 60 60 ioNetworkClient.o \ 61 io String.o \61 ioMemory.o \ 62 62 rpcValue.o \ 63 63 rpcMethod.o \ -
trunk/configure
r1140 r1163 10757 10757 ## 10758 10758 10759 ac_config_files="$ac_config_files Makefile bin/dodo-config tests/Makefile tests/image_test/Makefile tests/cgifast_test/Makefile tests/cgi_test/Makefile tests/dbmysql_test/Makefile tests/dbpostgresql_test/Makefile tests/dbsqlite_test/Makefile tests/db_test/Makefile tests/iononblocked_ionetwork_test/Makefile tests/iononblocked_ionetworkssl_test/Makefile tests/iostdio_test/Makefile tests/iofile_toolsfilesystem_test/Makefile tests/io string_test/Makefile tests/iopipe_iofilefifo_pcthreadcollection_test/Makefile tests/ionetwork_pcthreads_test/Makefile tests/ionetworkclient_test/Makefile tests/ionetworkserver_test/Makefile tests/ionetworksslserver_test/Makefile tests/ionetworksslclient_test/Makefile tests/ionetworkhttp_test/Makefile tests/pcthreadcollection_test/Makefile tests/pcprocesscollection_test/Makefile tests/pcjobcollection_test/Makefile tests/toolsnetwork_test/Makefile tests/toolsos_test/Makefile tests/toolstime_test/Makefile tests/toolsmisc_test/Makefile tests/toolscode_test/Makefile tests/toolslogger_test/Makefile tests/toolslibrary_test/Makefile tests/toolsregexp_test/Makefile tests/xexec_test/Makefile tests/rpcxmlhttpclient_test/Makefile tests/rpcxmlcgiserver_test/Makefile tests/rpcjsonhttpclient_test/Makefile tests/rpcjsoncgiserver_test/Makefile tests/dataformatjson_test/Makefile tests/dataformatxml_test/Makefile"10759 ac_config_files="$ac_config_files Makefile bin/dodo-config tests/Makefile tests/image_test/Makefile tests/cgifast_test/Makefile tests/cgi_test/Makefile tests/dbmysql_test/Makefile tests/dbpostgresql_test/Makefile tests/dbsqlite_test/Makefile tests/db_test/Makefile tests/iononblocked_ionetwork_test/Makefile tests/iononblocked_ionetworkssl_test/Makefile tests/iostdio_test/Makefile tests/iofile_toolsfilesystem_test/Makefile tests/iomemory_test/Makefile tests/iopipe_iofilefifo_pcthreadcollection_test/Makefile tests/ionetwork_pcthreads_test/Makefile tests/ionetworkclient_test/Makefile tests/ionetworkserver_test/Makefile tests/ionetworksslserver_test/Makefile tests/ionetworksslclient_test/Makefile tests/ionetworkhttp_test/Makefile tests/pcthreadcollection_test/Makefile tests/pcprocesscollection_test/Makefile tests/pcjobcollection_test/Makefile tests/toolsnetwork_test/Makefile tests/toolsos_test/Makefile tests/toolstime_test/Makefile tests/toolsmisc_test/Makefile tests/toolscode_test/Makefile tests/toolslogger_test/Makefile tests/toolslibrary_test/Makefile tests/toolsregexp_test/Makefile tests/xexec_test/Makefile tests/rpcxmlhttpclient_test/Makefile tests/rpcxmlcgiserver_test/Makefile tests/rpcjsonhttpclient_test/Makefile tests/rpcjsoncgiserver_test/Makefile tests/dataformatjson_test/Makefile tests/dataformatxml_test/Makefile" 10760 10760 10761 10761 … … 11383 11383 "tests/iostdio_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/iostdio_test/Makefile" ;; 11384 11384 "tests/iofile_toolsfilesystem_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/iofile_toolsfilesystem_test/Makefile" ;; 11385 "tests/io string_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/iostring_test/Makefile" ;;11385 "tests/iomemory_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/iomemory_test/Makefile" ;; 11386 11386 "tests/iopipe_iofilefifo_pcthreadcollection_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/iopipe_iofilefifo_pcthreadcollection_test/Makefile" ;; 11387 11387 "tests/ionetwork_pcthreads_test/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ionetwork_pcthreads_test/Makefile" ;; -
trunk/configure.in
r1161 r1163 769 769 tests/iostdio_test/Makefile 770 770 tests/iofile_toolsfilesystem_test/Makefile 771 tests/io string_test/Makefile771 tests/iomemory_test/Makefile 772 772 tests/iopipe_iofilefifo_pcthreadcollection_test/Makefile 773 773 tests/ionetwork_pcthreads_test/Makefile -
trunk/include/libdodo/exceptionBasic.h
r1160 r1163 113 113 ERRMODULE_IOPIPE, 114 114 ERRMODULE_IOSTDIO, 115 ERRMODULE_IO STRING,115 ERRMODULE_IOMEMORY, 116 116 ERRMODULE_IONETWORKCONNECTION, 117 117 ERRMODULE_IONETWORKCLIENT, -
trunk/include/libdodo/ioMemory.h
r1160 r1163 1 1 /*************************************************************************** 2 * io String.h2 * ioMemory.h 3 3 * 4 4 * Tue Oct 8 08:19:57 2005 … … 28 28 */ 29 29 30 #ifndef _IO STRING_H_31 #define _IO STRING_H_ 130 #ifndef _IOMEMORY_H_ 31 #define _IOMEMORY_H_ 1 32 32 33 33 #include <libdodo/directives.h> … … 39 39 #include <libdodo/types.h> 40 40 #include <libdodo/ioChannel.h> 41 #include <libdodo/io StringEx.h>41 #include <libdodo/ioMemoryEx.h> 42 42 43 43 namespace dodo … … 46 46 { 47 47 /** 48 * @class string49 * @brief provides stringI/O manipulations48 * @class memory 49 * @brief provides memory I/O manipulations 50 50 * @note if blockOffset is false then read/write position is amount of bytes from the beginning, if true then: 51 51 * writeStream, writeStream write only to the end of the file(append) 52 52 * write offset for write, write is calculated as pos*outSize 53 53 * read offset for read, read is calculated as pos*inSize 54 * read offset for readStream, readStream is calculated as pos*'# of \n - terminated strings'54 * read offset for readStream, readStream is calculated as pos*'# of \n - terminated memorys' 55 55 */ 56 class string: virtual public channel56 class memory : virtual public channel 57 57 { 58 58 public: … … 61 61 * constructor 62 62 */ 63 string();63 memory(); 64 64 65 65 /** … … 67 67 * @note xexec object is not copied 68 68 */ 69 string(const string&fd);69 memory(const memory &fd); 70 70 71 71 /** … … 73 73 * @note xexec object is not copied 74 74 */ 75 string(const dodoString &data);75 memory(const dodoString &data); 76 76 77 77 /** 78 78 * destructor 79 79 */ 80 virtual ~ string();80 virtual ~memory(); 81 81 82 82 /** … … 85 85 * @note xexec object is not copied 86 86 */ 87 virtual void clone(const string&fd);87 virtual void clone(const memory &fd); 88 88 89 89 /** … … 102 102 103 103 /** 104 * @return string104 * @return memory 105 105 */ 106 106 operator const dodoString &(); 107 107 108 108 /** 109 * @return string109 * @return memory 110 110 */ 111 111 operator const char*(); … … 131 131 132 132 /** 133 * read from stream - '\0' or '\n' - terminated string133 * read from stream - '\0' or '\n' - terminated memory 134 134 * @param data defines buffer that will be filled 135 135 * @note not more then inSize(including '\0') 136 * if blockOffset is true read offset is calculated as pos*'# of \n - terminated strings' otherwise offset it taken pos bytes from the beginning136 * if blockOffset is true read offset is calculated as pos*'# of \n - terminated memorys' otherwise offset it taken pos bytes from the beginning 137 137 */ 138 138 virtual unsigned long _readStream(char * const data); … … 145 145 146 146 /** 147 * write to stream - '\0' - terminated string147 * write to stream - '\0' - terminated memory 148 148 * @param data defines data that will be written 149 149 * @note write only to the end of the file(append) -
trunk/include/libdodo/ioMemoryEx.h
r1160 r1163 1 1 /*************************************************************************** 2 * io StringEx.h2 * ioMemoryEx.h 3 3 * 4 4 * Mon Feb 21 03:03:47 2005 … … 28 28 */ 29 29 30 #ifndef _IO STRINGEX_H_31 #define _IO STRINGEX_H_ 130 #ifndef _IOMEMORYEX_H_ 31 #define _IOMEMORYEX_H_ 1 32 32 33 33 #include <libdodo/directives.h> … … 42 42 * libdodo defined errors 43 43 */ 44 enum stringExR44 enum memoryExR 45 45 { 46 STRINGEX_CANTBEUSEDWITHIOEVENT,47 STRINGEX_OUTOFBOUNDS,46 MEMORYEX_CANTBEUSEDWITHIOEVENT, 47 MEMORYEX_OUTOFBOUNDS, 48 48 }; 49 49 … … 51 51 * explanations for libdodo defined errors 52 52 */ 53 #define IO STRINGEX_CANTBEUSEDWITHIOEVENT_STR "io::stringcan not be used with io::event."54 #define IO STRINGEX_OUTOFBOUNDS_STR "Access data out of bounds."53 #define IOMEMORYEX_CANTBEUSEDWITHIOEVENT_STR "io::memory can not be used with io::event." 54 #define IOMEMORYEX_OUTOFBOUNDS_STR "Access data out of bounds." 55 55 56 56 /** 57 57 * IDs of functions where exception might be thrown 58 58 */ 59 enum stringFunctionsID59 enum memoryFunctionsID 60 60 { 61 STRINGEX__READ,62 STRINGEX_GETINDESCRIPTOR,63 STRINGEX_GETOUTDESCRIPTOR,61 MEMORYEX__READ, 62 MEMORYEX_GETINDESCRIPTOR, 63 MEMORYEX_GETOUTDESCRIPTOR, 64 64 }; 65 65 }; -
trunk/include/libdodo/xexec.h
r1160 r1163 58 58 XEXEC_OBJECT_IOFILEFIFO, 59 59 XEXEC_OBJECT_IOPIPE, 60 XEXEC_OBJECT_IO STRING,60 XEXEC_OBJECT_IOMEMORY, 61 61 XEXEC_OBJECT_IONETWORKCLIENT, 62 62 XEXEC_OBJECT_IONETWORKSERVER, -
trunk/src/ioMemory.cc
r1162 r1163 1 1 /*************************************************************************** 2 * io String.cc2 * ioMemory.cc 3 3 * 4 4 * Wed Oct 8 01:44:18 2005 … … 28 28 */ 29 29 30 #include <libdodo/io String.h>30 #include <libdodo/ioMemory.h> 31 31 32 32 using namespace dodo::io; 33 33 34 string::string() : pos(0),34 memory::memory() : pos(0), 35 35 blockOffset(false), 36 36 append(false) … … 38 38 #ifndef IO_WO_XEXEC 39 39 40 collectedData.setExecObject(XEXEC_OBJECT_IO STRING);40 collectedData.setExecObject(XEXEC_OBJECT_IOMEMORY); 41 41 42 42 #endif … … 45 45 //------------------------------------------------------------------- 46 46 47 string::string(const string&fd) : pos(fd.pos),47 memory::memory(const memory &fd) : pos(fd.pos), 48 48 blockOffset(fd.blockOffset), 49 49 append(fd.append), … … 62 62 //------------------------------------------------------------------- 63 63 64 string::string(const dodoString &data) : pos(0),64 memory::memory(const dodoString &data) : pos(0), 65 65 blockOffset(false), 66 66 append(false), … … 76 76 //------------------------------------------------------------------- 77 77 78 string::~string()78 memory::~memory() 79 79 { 80 80 } … … 83 83 84 84 int 85 string::getInDescriptor() const86 { 87 throw exception::basic(exception::ERRMODULE_IO STRING, STRINGEX_GETINDESCRIPTOR, exception::ERRNO_LIBDODO, STRINGEX_CANTBEUSEDWITHIOEVENT, IOSTRINGEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__);85 memory::getInDescriptor() const 86 { 87 throw exception::basic(exception::ERRMODULE_IOMEMORY, MEMORYEX_GETINDESCRIPTOR, exception::ERRNO_LIBDODO, MEMORYEX_CANTBEUSEDWITHIOEVENT, IOMEMORYEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__); 88 88 89 89 return -1; … … 93 93 94 94 int 95 string::getOutDescriptor() const96 { 97 throw exception::basic(exception::ERRMODULE_IO STRING, STRINGEX_GETOUTDESCRIPTOR, exception::ERRNO_LIBDODO, STRINGEX_CANTBEUSEDWITHIOEVENT, IOSTRINGEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__);95 memory::getOutDescriptor() const 96 { 97 throw exception::basic(exception::ERRMODULE_IOMEMORY, MEMORYEX_GETOUTDESCRIPTOR, exception::ERRNO_LIBDODO, MEMORYEX_CANTBEUSEDWITHIOEVENT, IOMEMORYEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__); 98 98 99 99 return -1; … … 103 103 104 104 void 105 string::flush()106 { 107 } 108 109 //------------------------------------------------------------------- 110 111 string::operator const dodoString105 memory::flush() 106 { 107 } 108 109 //------------------------------------------------------------------- 110 111 memory::operator const dodoString 112 112 & () 113 113 { … … 117 117 //------------------------------------------------------------------- 118 118 119 string::operator const char119 memory::operator const char 120 120 *() 121 121 { … … 126 126 127 127 void 128 string::clone(const string&fd)128 memory::clone(const memory &fd) 129 129 { 130 130 pc::sync::protector pg(keeper); … … 142 142 143 143 void 144 string::_read(char * const a_data)144 memory::_read(char * const a_data) 145 145 { 146 146 unsigned long pos = blockOffset ? this->pos * inSize : this->pos; … … 148 148 if ((pos + inSize) > buffer.size()) 149 149 { 150 throw exception::basic(exception::ERRMODULE_IO STRING, STRINGEX__READ, exception::ERRNO_LIBDODO, STRINGEX_OUTOFBOUNDS, IOSTRINGEX_OUTOFBOUNDS_STR, __LINE__, __FILE__);150 throw exception::basic(exception::ERRMODULE_IOMEMORY, MEMORYEX__READ, exception::ERRNO_LIBDODO, MEMORYEX_OUTOFBOUNDS, IOMEMORYEX_OUTOFBOUNDS_STR, __LINE__, __FILE__); 151 151 } 152 152 … … 159 159 160 160 void 161 string::_write(const char *const a_data)161 memory::_write(const char *const a_data) 162 162 { 163 163 if (append) … … 182 182 183 183 void 184 string::erase()184 memory::erase() 185 185 { 186 186 pc::sync::protector pg(keeper); … … 200 200 201 201 unsigned long 202 string::_readStream(char * const a_data)202 memory::_readStream(char * const a_data) 203 203 { 204 204 unsigned long readSize = inSize + 1; … … 263 263 264 264 void 265 string::_writeStream(const char *const a_data)265 memory::_writeStream(const char *const a_data) 266 266 { 267 267 unsigned long _outSize = outSize; -
trunk/tests/iomemory_test/test.cc
r1146 r1163 6 6 7 7 #include <libdodo/exceptionBasic.h> 8 #include <libdodo/io String.h>8 #include <libdodo/ioMemory.h> 9 9 #include <libdodo/toolsCode.h> 10 10 … … 21 21 try 22 22 { 23 io:: stringio;23 io::memory io; 24 24 io.blockOffset = true; 25 25 … … 29 29 io.writeStream("!12345890$!!@\n"); 30 30 31 io:: stringio2 = io;31 io::memory io2 = io; 32 32 33 33 io2.pos = 1;
Note: See TracChangeset
for help on using the changeset viewer.
