diff options
author | Nikolai Pretzell <np@openoffice.org> | 2002-05-14 07:08:46 +0000 |
---|---|---|
committer | Nikolai Pretzell <np@openoffice.org> | 2002-05-14 07:08:46 +0000 |
commit | 41022e5f7242a979eb757a5eb51b45d5fba6d200 (patch) | |
tree | 21e3588c9a9b1b4ee40a7207c34f117c18fc276b /cosv/inc | |
parent | 5e64ff8760e61b03b13726ab90f14cbf6324e309 (diff) |
#98964#, New layout for IDL-docu and some fixes for gcc and in Filehandling
Diffstat (limited to 'cosv/inc')
-rw-r--r-- | cosv/inc/cosv/comfunc.hxx | 10 | ||||
-rw-r--r-- | cosv/inc/cosv/csv_env.hxx | 29 | ||||
-rw-r--r-- | cosv/inc/cosv/csv_precomp.h | 6 | ||||
-rw-r--r-- | cosv/inc/cosv/openclose.hxx | 6 | ||||
-rw-r--r-- | cosv/inc/cosv/persist.hxx | 6 | ||||
-rw-r--r-- | cosv/inc/cosv/ploc.hxx | 8 | ||||
-rw-r--r-- | cosv/inc/cosv/ploc_dir.hxx | 4 | ||||
-rw-r--r-- | cosv/inc/cosv/streamstr.hxx | 28 |
8 files changed, 64 insertions, 33 deletions
diff --git a/cosv/inc/cosv/comfunc.hxx b/cosv/inc/cosv/comfunc.hxx index ea9badcb454a..a1c05f8e7bee 100644 --- a/cosv/inc/cosv/comfunc.hxx +++ b/cosv/inc/cosv/comfunc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: comfunc.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-03-22 10:22:47 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -117,11 +117,11 @@ switch_endian( NUMTYPE & o_rNumber, const NUMTYPE & i_rNumber ) { char * pFront = reinterpret_cast< char* >(&o_rNumber); - const char * pBack = reinterpret_cast< const char* >(&i_rNumber) + (sizeof(NUMTYPE) - 1); + const char * pBack = reinterpret_cast< const char* >(&i_rNumber) + sizeof(NUMTYPE); - for ( unsigned int p = sizeof(NUMTYPE); p != 0; --p ) + for ( size_t p = 0; p < sizeof(NUMTYPE); --p ) { - *pFront++ = *pBack--; + *pFront++ = *(--pBack); } } diff --git a/cosv/inc/cosv/csv_env.hxx b/cosv/inc/cosv/csv_env.hxx index 746cfb7822d4..8dbd6ae5380d 100644 --- a/cosv/inc/cosv/csv_env.hxx +++ b/cosv/inc/cosv/csv_env.hxx @@ -2,9 +2,9 @@ * * $RCSfile: csv_env.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:38 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,7 +67,7 @@ // BEGIN Compiler dependent defines regarding standard compliance, // subject to changes: // #define CSV_NO_BOOL_TYPE // States that no system type 'bool' exists -#define CSV_NO_MUTABLE // No keyword mutable +// #define CSV_NO_MUTABLE // No keyword mutable #define CSV_NO_EXPLICIT // No keyword explicit // #define CSV_NO_IOSTREAMS // No iostreams // END Compiler dependent defines, subject to changes @@ -158,22 +158,27 @@ void PerformAssertion( // Subject to change to more sophisticated handling #define precond(x) csv_assert(x) #define postcond(x) csv_assert(x) -#define csv_assert(x) ( (x) ? (void)(0) : csv::PerformAssertion( #x, __FILE__, __LINE__) ) -#define csv_noimpl(x) csv::PerformAssertion( "Functon " #x " is not yet implemented.", __FILE__, __LINE__) -#define csv_exception csv::PerformAssertion( "Exception to be raised.", __FILE__, __LINE__) + +#ifdef CSV_USE_CSV_ASSERTIONS +#define csv_assert(x) ( (x) ? (void)(0) : ::csv::PerformAssertion( #x, __FILE__, __LINE__) ) +#define csv_noimpl(x) ::csv::PerformAssertion( "Functon " #x " is not yet implemented.", __FILE__, __LINE__) +#define csv_exception ::csv::PerformAssertion( "Exception to be raised.", __FILE__, __LINE__) #else +#include <assert.h> +#define csv_assert(x) assert(x); +#define csv_noimpl(x) assert(x); +#define csv_exception assert(x); +#endif + +#else // #ifndef CSV_NO_ASSERTIONS else + #define precond(x) #define postcond(x) #define csv_assert(x) #define csv_noimpl(x) #define csv_exception -#endif // end ifndef NDEBUG else - - - - - +#endif // end ifndef CSV_NO_ASSERTIONS else diff --git a/cosv/inc/cosv/csv_precomp.h b/cosv/inc/cosv/csv_precomp.h index 301776c6283c..7a36fa77ecc8 100644 --- a/cosv/inc/cosv/csv_precomp.h +++ b/cosv/inc/cosv/csv_precomp.h @@ -2,9 +2,9 @@ * * $RCSfile: csv_precomp.h,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:38 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,7 +63,9 @@ #define __CSV_PRECOMP_H_06071998__ +#define CSV_USE_CSV_ASSERTIONS #include <cosv/csv_env.hxx> + #include <cosv/comfunc.hxx> #include <cosv/string.hxx> #include <cosv/streamstr.hxx> diff --git a/cosv/inc/cosv/openclose.hxx b/cosv/inc/cosv/openclose.hxx index 1c4bf59805bc..f92184d06a30 100644 --- a/cosv/inc/cosv/openclose.hxx +++ b/cosv/inc/cosv/openclose.hxx @@ -2,9 +2,9 @@ * * $RCSfile: openclose.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:38 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -153,7 +153,7 @@ OpenCloseGuard::OpenCloseGuard( OpenClose & i_rOpenClose, { rOpenClose.open(i_nOpenModeInfo); } inline OpenCloseGuard::~OpenCloseGuard() - { rOpenClose.close(); } + { if (rOpenClose.is_open()) rOpenClose.close(); } inline OpenCloseGuard::operator bool() const { return rOpenClose.is_open(); } diff --git a/cosv/inc/cosv/persist.hxx b/cosv/inc/cosv/persist.hxx index 579754ff4682..cd36c9b5e5b3 100644 --- a/cosv/inc/cosv/persist.hxx +++ b/cosv/inc/cosv/persist.hxx @@ -2,9 +2,9 @@ * * $RCSfile: persist.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:39 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,7 +98,7 @@ class Persistent virtual ~Persistent() {} const Path & MyPath() const; - /// @return Path of directories without completing delimiter. + /// @return all pathes without completing delimiter, even directories. const char * StrPath() const; bool Exists() const; diff --git a/cosv/inc/cosv/ploc.hxx b/cosv/inc/cosv/ploc.hxx index 3ec4542693f6..d242a2f302e9 100644 --- a/cosv/inc/cosv/ploc.hxx +++ b/cosv/inc/cosv/ploc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ploc.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:39 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -115,8 +115,10 @@ class Path bool IsDirectory() const { return sFile.length() == 0; } bool IsFile() const { return sFile.length() > 0; } + /// Directories have a delimiter at the end, files not. virtual void Get( ostream & o_rPath ) const; + /// Directories have a delimiter at the end, files not. virtual void Get( bostream & o_rPath ) const; // ACCESS @@ -136,6 +138,7 @@ class Path +/// Directories produce a delimiter at the end, files not. inline csv::ostream & operator<<( csv::ostream & o_rOut, const csv::ploc::Path & i_rPath ) @@ -144,6 +147,7 @@ operator<<( csv::ostream & o_rOut, return o_rOut; } +/// Directories produce a delimiter at the end, files not. inline csv::bostream & operator<<( csv::bostream & o_rOut, const csv::ploc::Path & i_rPath ) diff --git a/cosv/inc/cosv/ploc_dir.hxx b/cosv/inc/cosv/ploc_dir.hxx index 1dfd2634dd39..aa39ee2365a1 100644 --- a/cosv/inc/cosv/ploc_dir.hxx +++ b/cosv/inc/cosv/ploc_dir.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ploc_dir.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-05-02 12:35:10 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/cosv/inc/cosv/streamstr.hxx b/cosv/inc/cosv/streamstr.hxx index e17b8cdd3001..419f025927f7 100644 --- a/cosv/inc/cosv/streamstr.hxx +++ b/cosv/inc/cosv/streamstr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: streamstr.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:39 $ + * last change: $Author: np $ $Date: 2002-05-14 08:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,9 +76,12 @@ namespace csv { +class String; void c_str(); // Dummy needed for StreamStr::operator<<(StreamStr::F_CSTR); + + /** Diese Klasse hat alle Funktionalitaet von strstream. Der Buffer braucht jedoch weder uebergeben noch (nach Gebrauch) geloescht zu werden. Seine Groesse wird @@ -127,13 +130,13 @@ class StreamStr : public bostream const char * str1, // [!= 0] const char * str2, // [!= 0] ... ); // Has to end with NIL . - /// Copies also inssert_mode and current position. + /// Copies also insert_mode and current position. StreamStr( const self & i_rOther ); ~StreamStr(); // OPERATORS - /// Copies also inssert_mode and current position. + /// Copies also insert_mode and current position. self & operator=( const self & i_rOther ); @@ -186,6 +189,7 @@ class StreamStr : public bostream self & seekp( seek_type i_nCount, seek_dir i_eDirection = ::csv::beg ); + self & reset() { return seekp(0); } /** Sets the insertion mode of all and only the operator<<() calls. str::overwrite: seekp() always sets the cur end of the string. @@ -212,6 +216,22 @@ class StreamStr : public bostream void pop_back( size_type i_nCount ); + /// Works like operator<<() + self & operator_join( + std::vector<String>::const_iterator + i_rBegin, + std::vector<String>::const_iterator + i_rEnd, + const char * i_sLink ); + /// Works like operator<<() + self & operator_add_substr( + const char * i_sText, + size_type i_nLength ); + /// Works like operator<<() + self & operator_add_token( + const char * i_sText, + char i_cDelimiter ); + //*********** Not yet implemented *********************// void strip_front( char i_cToRemove ); |