From 179fc2e2e25d3e9bc7c198b1e9ea6651fc6de84a Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Tue, 18 Mar 2003 12:53:28 +0000 Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD --- cosv/source/fullcpp.mk | 4 ++-- cosv/source/storage/persist.cxx | 38 ++++++++++++++++++++++++++++++++------ cosv/source/storage/ploc_dir.cxx | 30 +++++++++++++++++++++++++++--- cosv/source/strings/streamstr.cxx | 28 ++++++++++++++-------------- 4 files changed, 75 insertions(+), 25 deletions(-) (limited to 'cosv') diff --git a/cosv/source/fullcpp.mk b/cosv/source/fullcpp.mk index 1c0af373f6c5..b9142752367f 100644 --- a/cosv/source/fullcpp.mk +++ b/cosv/source/fullcpp.mk @@ -2,9 +2,9 @@ # # $RCSfile: fullcpp.mk,v $ # -# $Revision: 1.4 $ +# $Revision: 1.5 $ # -# last change: $Author: hjs $ $Date: 2002-09-03 13:07:07 $ +# last change: $Author: hr $ $Date: 2003-03-18 13:48:51 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses diff --git a/cosv/source/storage/persist.cxx b/cosv/source/storage/persist.cxx index 9087c88b5c12..3af42b6c2de9 100644 --- a/cosv/source/storage/persist.cxx +++ b/cosv/source/storage/persist.cxx @@ -2,9 +2,9 @@ * * $RCSfile: persist.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:25:40 $ + * last change: $Author: hr $ $Date: 2003-03-18 13:48:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,23 +67,41 @@ #include +#ifdef WNT +#include + namespace csv { namespace ploc { -#ifdef WNT -#include - bool Persistent::Exists() const { return access( StrPath(), 00) == 0; } +} // namespace ploc +} // namespace csv + + #elif defined(UNX) #include +/* +#ifndef __SUNPRO_CC +#include +#else +#define F_OK 0 // Test for existence of File +extern int access(const char *, int); +#endif +*/ + +namespace csv +{ +namespace ploc +{ + bool Persistent::Exists() const { @@ -91,10 +109,18 @@ Persistent::Exists() const } +} // namespace ploc +} // namespace csv + #else #error For using csv::ploc there has to be defined: WNT or UNX. #endif +namespace csv +{ +namespace ploc +{ + const char * Persistent::StrPath() const { @@ -113,9 +139,9 @@ Persistent::StrPath() const return sPath.c_str(); } - } // namespace ploc } // namespace csv + diff --git a/cosv/source/storage/ploc_dir.cxx b/cosv/source/storage/ploc_dir.cxx index cf41a2746243..37d0ba8b63a2 100644 --- a/cosv/source/storage/ploc_dir.cxx +++ b/cosv/source/storage/ploc_dir.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ploc_dir.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: np $ $Date: 2002-11-01 12:18:53 $ + * last change: $Author: hr $ $Date: 2003-03-18 13:48:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -164,12 +164,19 @@ Directory::Check_Parent() const return ret; } +} // namespace ploc +} // namespace csv #ifdef WNT #include #include +namespace csv +{ +namespace ploc +{ + bool Directory::PhysicalCreate_Dir( const char * i_sStr ) const { @@ -252,11 +259,19 @@ Directory::GetContainedFiles( StringVector & o_rResult, } } +} // namespace ploc +} // namespace csv + + #elif defined(UNX) #include #include #include -#include + +namespace csv +{ +namespace ploc +{ bool Directory::PhysicalCreate_Dir( const char * i_sStr ) const @@ -354,11 +369,20 @@ Directory::GetContainedFiles( StringVector & o_rResult, } } +} // namespace ploc +} // namespace csv + + #else #error For using csv::ploc there has to be defined: WNT or UNX. #endif +namespace csv +{ +namespace ploc +{ + const Path & Directory::inq_MyPath() const { diff --git a/cosv/source/strings/streamstr.cxx b/cosv/source/strings/streamstr.cxx index b3c4e2ca64c0..1eb29bc19845 100644 --- a/cosv/source/strings/streamstr.cxx +++ b/cosv/source/strings/streamstr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: streamstr.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: np $ $Date: 2002-11-01 12:18:53 $ + * last change: $Author: hr $ $Date: 2003-03-18 13:48:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -108,7 +108,7 @@ StreamStr::StreamStr( const char * i_sInitStr, size_type nLength = strlen(i_sInitStr); nCapacity1 = csv::max(nLength, i_nCapacity) + 1; dpData = new char [nCapacity1]; - strcpy(dpData, i_sInitStr); + strcpy(dpData, i_sInitStr); // SAFE STRCPY (#100211# - checked) pCur = dpData + nLength; pEnd = pCur; } @@ -150,7 +150,7 @@ StreamStr::StreamStr( const self & i_rOther ) pCur( dpData + i_rOther.tellp() ), eMode(i_rOther.eMode) { - strcpy( dpData, i_rOther.dpData ); + strcpy( dpData, i_rOther.dpData ); // SAFE STRCPY (#100211# - checked) } StreamStr::~StreamStr() @@ -167,7 +167,7 @@ StreamStr::operator=( const self & i_rOther ) nCapacity1 = i_rOther.nCapacity1; dpData = new char [i_rOther.nCapacity1]; pEnd = dpData + strlen(i_rOther.dpData); - strcpy( dpData, i_rOther.dpData ); + strcpy( dpData, i_rOther.dpData ); // SAFE STRCPY (#100211# - checked) pCur = dpData + i_rOther.tellp(); eMode = i_rOther.eMode; @@ -224,7 +224,7 @@ StreamStr & StreamStr::operator<<( short i_n ) { char buf[C_short_max_size] = ""; - sprintf( buf, "%hi", i_n ); + sprintf( buf, "%hi", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -238,7 +238,7 @@ StreamStr & StreamStr::operator<<( unsigned short i_n ) { char buf[C_short_max_size] = ""; - sprintf( buf, "%hu", i_n ); + sprintf( buf, "%hu", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -252,7 +252,7 @@ StreamStr & StreamStr::operator<<( int i_n ) { char buf[C_int_max_size] = ""; - sprintf( buf, "%i", i_n ); + sprintf( buf, "%i", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -266,7 +266,7 @@ StreamStr & StreamStr::operator<<( unsigned int i_n ) { char buf[C_int_max_size] = ""; - sprintf( buf, "%u", i_n ); + sprintf( buf, "%u", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -280,7 +280,7 @@ StreamStr & StreamStr::operator<<( long i_n ) { char buf[C_long_max_size] = ""; - sprintf( buf, "%li", i_n ); + sprintf( buf, "%li", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -294,7 +294,7 @@ StreamStr & StreamStr::operator<<( unsigned long i_n ) { char buf[C_long_max_size] = ""; - sprintf( buf, "%lu", i_n ); + sprintf( buf, "%lu", i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -309,7 +309,7 @@ StreamStr::operator<<( float i_n ) { const int C_float_max_size = 20; char buf[C_float_max_size] = ""; - sprintf( buf, "%.*g", C_float_max_size-8, i_n ); + sprintf( buf, "%.*g", C_float_max_size-8, i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -324,7 +324,7 @@ StreamStr::operator<<( double i_n ) { const int C_double_max_size = 30; char buf[C_double_max_size] = ""; - sprintf( buf, "%.*lg", C_double_max_size-8, i_n ); + sprintf( buf, "%.*lg", C_double_max_size-8, i_n ); // SAFE SPRINTF (#100211# - checked) size_type nLength = strlen(buf); ProvideAddingSize( nLength ); @@ -809,7 +809,7 @@ StreamStr::Resize( size_type i_nMinimumCapacity ) nCapacity1 = csv::max( nNewSize, size_type(i_nMinimumCapacity + 1) ); char * pNew = new char[nCapacity1]; - strcpy ( pNew, dpData ); + strcpy ( pNew, dpData ); // SAFE STRCPY (#100211# - checked) pEnd = pNew + (pEnd - dpData); pCur = pNew + (pCur - dpData); -- cgit