summaryrefslogtreecommitdiff
path: root/cosv
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-21 12:10:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-21 12:10:55 +0100
commitcd4395feb590a6f8fa1123dcd590e97a7c0cd302 (patch)
tree0b8adda820e3f5e896b6113058bc001cbd91b055 /cosv
parent5cda8705d3b573d7f155bcadbc1b088d916303a6 (diff)
various unused junk
Diffstat (limited to 'cosv')
-rw-r--r--cosv/inc/cosv/comfunc.hxx1
-rw-r--r--cosv/inc/cosv/dirchain.hxx4
-rw-r--r--cosv/inc/cosv/file.hxx9
-rw-r--r--cosv/inc/cosv/ploc_dir.hxx2
-rw-r--r--cosv/inc/cosv/streamstr.hxx33
-rw-r--r--cosv/inc/cosv/string.hxx41
-rw-r--r--cosv/source/service/comfunc.cxx13
-rw-r--r--cosv/source/storage/dirchain.cxx7
-rw-r--r--cosv/source/storage/file.cxx41
-rw-r--r--cosv/source/storage/ploc_dir.cxx5
-rw-r--r--cosv/source/strings/streamstr.cxx201
-rw-r--r--cosv/source/strings/string.cxx99
12 files changed, 1 insertions, 455 deletions
diff --git a/cosv/inc/cosv/comfunc.hxx b/cosv/inc/cosv/comfunc.hxx
index f0f513e87270..41fde3f8ce8c 100644
--- a/cosv/inc/cosv/comfunc.hxx
+++ b/cosv/inc/cosv/comfunc.hxx
@@ -51,7 +51,6 @@ inline bool in_range(E low, E val, E high); // return low <= val < hi
// string functions
inline const char * valid_str(const char * str);
inline bool no_str(const char * str); // return !str || !strlen(str)
-intt count_chars(const char * str, char c);
// IMPLEMENTATION
diff --git a/cosv/inc/cosv/dirchain.hxx b/cosv/inc/cosv/dirchain.hxx
index c36c574cdf5a..3c53134f0396 100644
--- a/cosv/inc/cosv/dirchain.hxx
+++ b/cosv/inc/cosv/dirchain.hxx
@@ -55,10 +55,6 @@ class DirectoryChain
public:
DirectoryChain();
DirectoryChain(
- const char * i_sPath,
- bool i_bPathIsAlwaysDir = false,
- const char * i_sDelimiter = Delimiter() );
- DirectoryChain(
const DirectoryChain &
i_rDC );
~DirectoryChain();
diff --git a/cosv/inc/cosv/file.hxx b/cosv/inc/cosv/file.hxx
index 573764eda857..9d12cac4d6cf 100644
--- a/cosv/inc/cosv/file.hxx
+++ b/cosv/inc/cosv/file.hxx
@@ -58,8 +58,6 @@ class File : public bstream,
public:
// LIFECYCLE
File(
- uintt i_nMode = CFM_RW );
- File(
const ::csv::ploc::Path &
i_rLocation,
uintt i_nMode = CFM_RW );
@@ -71,13 +69,6 @@ class File : public bstream,
uintt in_nMode = CFM_RW );
virtual ~File();
- // OPERATIONS
- bool Assign(
- ploc::Path i_rLocation );
- bool Assign(
- const char * i_sLocation );
- bool Assign(
- const String & i_sLocation );
// INQUIRY
uintt Mode() const;
diff --git a/cosv/inc/cosv/ploc_dir.hxx b/cosv/inc/cosv/ploc_dir.hxx
index adc9584912bb..ef2855f9c981 100644
--- a/cosv/inc/cosv/ploc_dir.hxx
+++ b/cosv/inc/cosv/ploc_dir.hxx
@@ -60,8 +60,6 @@ class Directory : public Persistent
Directory(
const char * i_rLocation );
Directory(
- const String & i_rLocation );
- Directory(
const Directory & i_rDir );
virtual ~Directory();
diff --git a/cosv/inc/cosv/streamstr.hxx b/cosv/inc/cosv/streamstr.hxx
index 67a69b24791a..c27d504451cd 100644
--- a/cosv/inc/cosv/streamstr.hxx
+++ b/cosv/inc/cosv/streamstr.hxx
@@ -87,13 +87,6 @@ class StreamStr : public bostream
StreamStr(
const char * i_sInitStr,
size_type i_nCapacity ); /// Only used if > strlen(i_sInitStr).
- StreamStr(
- size_type i_nGuessedCapacity,
- const char * str1, // [!= 0]
- const char * str2, // [!= 0]
- ... ); // Has to end with NIL .
- StreamStr(
- csv::bstream & i_source );
/// Copies also insert_mode and current position.
StreamStr(
const self & i_rOther );
@@ -156,8 +149,6 @@ class StreamStr : public bostream
size_type i_nMinimumCapacity );
void clear();
- void swap(
- StreamStr & io_swap );
/** Sets start point for the next operator<<() call.
if the intended position is not reachable, nothing happens.
@@ -180,14 +171,6 @@ class StreamStr : public bostream
self & set_insert_mode(
insert_mode i_eMode );
- void push_front(
- const char * i_str );
- void push_front(
- char i_c );
- void push_back(
- const char * i_str );
- void push_back(
- char i_c );
void pop_front(
size_type i_nCount );
void pop_back(
@@ -216,18 +199,6 @@ class StreamStr : public bostream
void strip_back_whitespace();
void strip_frontback_whitespace();
- /** @precond i_begin is valid
- @precond i_end is valid
- @precond i_end >= i_begin
- */
- void remove(
- iterator i_begin,
- iterator i_end );
- void replace(
- position_type i_nStart,
- size_type i_nSize,
- Area i_aReplacement );
-
void replace_all(
char i_cCarToSearch,
char i_cReplacement );
@@ -252,10 +223,6 @@ class StreamStr : public bostream
const_iterator cur() const;
const_iterator end() const;
- String token(
- position_type i_nNr, /// Starting with 0.
- char i_cSpli ) const;
-
// ACCESS
iterator begin();
iterator cur();
diff --git a/cosv/inc/cosv/string.hxx b/cosv/inc/cosv/string.hxx
index 970b61fb36a8..4a57dd143d45 100644
--- a/cosv/inc/cosv/string.hxx
+++ b/cosv/inc/cosv/string.hxx
@@ -76,13 +76,7 @@ class String
String(
const char * i_str,
size_type i_nLength );
- /** @precond i_nLength == str::maxsize
- || i_nStartPosition+i_nLength <= i_rStr.Size().
- */
- String(
- const self & i_rStr,
- position_type i_nStartPosition,
- size_type i_nLength );
+
/** @precond i_itBegin and i_itEnd are in the same valid
memory-area, such that zero to finite times repetition of
++i_itBegin leads to i_itBegin == i_itEnd.
@@ -119,18 +113,6 @@ class String
// OPERATIONS
void clear();
- void swap(
- self & i_rStr );
-
- /** @precond i_nLength == str::maxsize
- || i_nStartPosition+i_nLength <= i_rStr.Size().
- */
- void assign(
- const self & i_rStr,
- position_type i_nStartPosition,
- size_type i_nLength );
- void assign(
- const char * i_str );
/// @precond i_nLength == str::maxsize OR i_nLength < strlen(i_str) .
void assign(
const char * i_str,
@@ -139,13 +121,6 @@ class String
void assign(
size_type i_nCount,
char i_c );
- /** @precond i_itBegin and i_itEnd are in the same valid
- memory-area, such that zero to finite times repetition of
- ++i_itBegin leads to i_itBegin == i_itEnd.
- */
- void assign(
- const_iterator i_itBegin,
- const_iterator i_itEnd );
// INQUIRY
const char * c_str() const;
@@ -170,20 +145,6 @@ class String
i_rOrder,
const self & i_rStr ) const;
- self substr(
- position_type i_nStartPosition = 0,
- size_type i_nLength = str::maxsize ) const;
-
- /** @param i_strToSearch [i_strToSearch != 0]
- i_strToSearch == "" will return npos.
- */
- position_type find(
- const char * i_strToSearch,
- position_type i_nSearchStartPosition = 0 ) const;
- position_type find(
- char i_charToSearch,
- position_type i_nSearchStartPosition = 0 ) const;
-
//*********** Not yet implemented *********************//
position_type rfind(
const char * i_strToSearch,
diff --git a/cosv/source/service/comfunc.cxx b/cosv/source/service/comfunc.cxx
index 3cdc9d80f7d6..46f2e63d527c 100644
--- a/cosv/source/service/comfunc.cxx
+++ b/cosv/source/service/comfunc.cxx
@@ -48,19 +48,6 @@ X_Default::GetInfo( ostream & o_rOutputMedium ) const
<< Endl;
}
-intt
-count_chars(const char * str, char c)
-{
- intt nCount = 0;
- for ( const char * pSpc = strchr(str, c);
- pSpc != 0;
- pSpc = strchr(pSpc+1, c) )
- {
- nCount++;
- }
- return nCount;
-}
-
} // namespace csv
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cosv/source/storage/dirchain.cxx b/cosv/source/storage/dirchain.cxx
index 22697688442d..fdaf9b12626f 100644
--- a/cosv/source/storage/dirchain.cxx
+++ b/cosv/source/storage/dirchain.cxx
@@ -45,13 +45,6 @@ DirectoryChain::DirectoryChain()
{
}
-DirectoryChain::DirectoryChain( const char * i_sSubPath,
- bool i_bPathIsAlwaysDir,
- const char * i_sDelimiter )
-{
- Set( i_sSubPath, i_bPathIsAlwaysDir, i_sDelimiter );
-}
-
DirectoryChain::~DirectoryChain()
{
}
diff --git a/cosv/source/storage/file.cxx b/cosv/source/storage/file.cxx
index 1313b62c2fc1..3be09d13695f 100644
--- a/cosv/source/storage/file.cxx
+++ b/cosv/source/storage/file.cxx
@@ -36,14 +36,6 @@ namespace csv
{
-File::File( uintt i_nMode )
- : // aPath,
- pStream(0),
- nMode(i_nMode),
- eLastIO(io_none)
-{
-}
-
File::File( const ploc::Path & i_rLocation,
uintt i_nMode )
: aPath(i_rLocation),
@@ -77,39 +69,6 @@ File::~File()
close();
}
-bool
-File::Assign( ploc::Path i_rLocation )
-{
- if (is_open() )
- return false;
-
- InvalidatePath();
- aPath = i_rLocation;
- return true;
-}
-
-bool
-File::Assign( const char * i_sLocation )
-{
- if (is_open() )
- return false;
-
- InvalidatePath();
- aPath.Set( i_sLocation );
- return true;
-}
-
-bool
-File::Assign( const String & i_sLocation )
-{
- if (is_open() )
- return false;
-
- InvalidatePath();
- aPath.Set( i_sLocation );
- return true;
-}
-
uintt
File::do_read( void * out_pDest,
uintt i_nNrofBytes )
diff --git a/cosv/source/storage/ploc_dir.cxx b/cosv/source/storage/ploc_dir.cxx
index fb4a84ac94e3..cb96fdfbc079 100644
--- a/cosv/source/storage/ploc_dir.cxx
+++ b/cosv/source/storage/ploc_dir.cxx
@@ -59,11 +59,6 @@ Directory::Directory( const char * i_rLocation )
{
}
-Directory::Directory( const String & i_rLocation )
- : aPath(i_rLocation.c_str(), true)
-{
-}
-
Directory::~Directory()
{
}
diff --git a/cosv/source/strings/streamstr.cxx b/cosv/source/strings/streamstr.cxx
index c1a0d62a0786..68a04355c3a2 100644
--- a/cosv/source/strings/streamstr.cxx
+++ b/cosv/source/strings/streamstr.cxx
@@ -84,37 +84,6 @@ StreamStr::StreamStr( const char * i_sInitStr,
pEnd = pCur;
}
-StreamStr::StreamStr( size_type i_nGuessedCapacity,
- const char * str1,
- const char * str2,
- ... )
- : bostream(),
- nCapacity1( i_nGuessedCapacity + 1 ),
- dpData( new char [i_nGuessedCapacity + 1] ),
- pEnd(dpData),
- pCur(dpData),
- eMode(str::overwrite)
-{
- *pEnd = '\0';
-
- operator<<(str1);
- operator<<(str2);
-
- ::va_list ap;
-
- va_start(ap, str2);
- for ( const char * strAdd = va_arg(ap,const char*);
- strAdd != 0;
- strAdd = va_arg(ap,const char*) )
- {
- size_type nLen = strlen(strAdd);
- ProvideAddingSize( nLen );
- memcpy(pCur, strAdd, nLen);
- Advance(nLen);
- } // end for
- va_end(ap);
-}
-
StreamStr::StreamStr( const self & i_rOther )
: bostream(),
nCapacity1( i_rOther.nCapacity1 ),
@@ -126,25 +95,6 @@ StreamStr::StreamStr( const self & i_rOther )
strcpy( dpData, i_rOther.dpData ); // SAFE STRCPY (#100211# - checked)
}
-StreamStr::StreamStr(csv::bstream & i_source)
- : bostream(),
- nCapacity1(0),
- dpData(0),
- pEnd(0),
- pCur(0),
- eMode(str::overwrite)
-{
- i_source.seek(0, csv::end);
- nCapacity1 = static_cast<size_type>(i_source.position()) + 1;
- i_source.seek(0);
-
- dpData = new char[nCapacity1];
- i_source.read(dpData, nCapacity1 - 1);
- pCur = dpData + nCapacity1 - 1;
- pEnd = pCur;
- *pCur = '\0';
-}
-
StreamStr::~StreamStr()
{
delete [] dpData;
@@ -355,33 +305,6 @@ StreamStr::resize( size_type i_nMinimumCapacity )
Resize(i_nMinimumCapacity);
}
-void
-StreamStr::swap( StreamStr & io_swap )
-{
- size_type
- n = io_swap.nCapacity1;
- io_swap.nCapacity1 = nCapacity1;
- nCapacity1 = n;
-
- char *
- p = io_swap.dpData;
- io_swap.dpData = dpData;
- dpData = p;
-
- p = io_swap.pEnd;
- io_swap.pEnd = pEnd;
- pEnd = p;
-
- p = io_swap.pCur;
- io_swap.pCur = pCur;
- pCur = p;
-
- insert_mode
- m = io_swap.eMode;
- io_swap.eMode = eMode;
- eMode = m;
-}
-
StreamStr &
StreamStr::seekp( seek_type i_nCount,
seek_dir i_eDirection )
@@ -420,56 +343,6 @@ StreamStr::set_insert_mode( insert_mode i_eMode )
}
void
-StreamStr::push_front( const char * i_str )
-{
- insert_mode eOriginalMode = eMode;
- char * pOriginalCur = pCur;
- eMode = str::insert;
- pCur = dpData;
-
- operator<<(i_str);
-
- eMode = eOriginalMode;
- pCur = pOriginalCur + strlen(i_str);
-}
-
-void
-StreamStr::push_front( char i_c )
-{
- insert_mode eOriginalMode = eMode;
- char * pOriginalCur = pCur;
- eMode = str::insert;
- pCur = dpData;
-
- operator<<(i_c);
-
- eMode = eOriginalMode;
- pCur = pOriginalCur + 1;
-}
-
-void
-StreamStr::push_back( const char * i_str )
-{
- insert_mode eOriginalMode = eMode;
- eMode = str::overwrite;
-
- operator<<(i_str);
-
- eMode = eOriginalMode;
-}
-
-void
-StreamStr::push_back( char i_c )
-{
- insert_mode eOriginalMode = eMode;
- eMode = str::overwrite;
-
- operator<<(i_c);
-
- eMode = eOriginalMode;
-}
-
-void
StreamStr::pop_front( size_type i_nCount )
{
size_type nCount = min(i_nCount, length());
@@ -588,56 +461,6 @@ StreamStr::strip_frontback_whitespace()
}
void
-StreamStr::remove( iterator i_begin,
- iterator i_end )
-{
- csv_assert(i_begin >= dpData AND i_begin <= pEnd);
- csv_assert(i_end >= dpData AND i_end <= pEnd);
- csv_assert(i_end >= i_begin);
- MoveData(i_end, pEnd, i_begin - i_end);
- pCur = pEnd;
-}
-
-void
-StreamStr::replace( position_type i_nStart,
- size_type i_nSize,
- Area i_aReplacement )
-{
- if (i_nStart >= length() OR i_nSize < 1)
- return;
-
- insert_mode eOldMode = eMode;
- eMode = str::insert;
- pCur = dpData + i_nStart;
-
- size_type anz = min( length() - i_nStart, i_nSize );
-
- if ( anz < i_aReplacement.nLength )
- {
- ProvideAddingSize( i_aReplacement.nLength - anz );
- }
- else if ( anz > i_aReplacement.nLength )
- {
- seek_type nMove = seek_type(anz - i_aReplacement.nLength);
-
- MoveData( dpData + i_nStart + anz,
- pEnd,
- -nMove );
- pEnd -= nMove;
- *pEnd = '\0';
- }
-
- if (i_aReplacement.nLength > 0)
- {
- memcpy( dpData + i_nStart, i_aReplacement.sStr, i_aReplacement.nLength );
- Advance(i_aReplacement.nLength);
- }
-
- eMode = eOldMode;
- pCur = pEnd;
-}
-
-void
StreamStr::replace_all( char i_cCarToSearch,
char i_cReplacement )
{
@@ -679,30 +502,6 @@ StreamStr::to_upper( position_type i_nStart,
return *this;
}
-String
-StreamStr::token( position_type i_nNr,
- char i_cSplit ) const
-{
- // Find begin:
- const char * pTokenBegin = dpData;
- for ( position_type nNr = i_nNr;
- nNr > 0;
- --nNr )
- {
- pTokenBegin = strchr(pTokenBegin,i_cSplit);
- if (pTokenBegin == 0)
- return String("");
- ++pTokenBegin;
- }
-
- // Find end:
- const char * pTokenEnd = strchr(pTokenBegin, i_cSplit);
- if (pTokenEnd == 0)
- pTokenEnd = pEnd;
-
- return String(pTokenBegin, size_type(pTokenEnd-pTokenBegin) );
-}
-
class StreamStrPool
{
public:
diff --git a/cosv/source/strings/string.cxx b/cosv/source/strings/string.cxx
index 5d09218e10c1..f5ada3e4f8f0 100644
--- a/cosv/source/strings/string.cxx
+++ b/cosv/source/strings/string.cxx
@@ -127,15 +127,6 @@ String::String( const char * i_str,
{
}
-/* For efficiency see the previous c'tor.
-*/
-String::String( const self & i_rStr,
- position_type i_nStartPosition,
- size_type i_nLength )
- : pd( new S_Data(str_from_StringOffset(i_rStr, i_nStartPosition), i_nLength) )
-{
-}
-
String::String( const_iterator i_itBegin,
const_iterator i_itEnd )
: pd( new S_Data(i_itBegin, size_type(i_itEnd - i_itBegin)) )
@@ -175,35 +166,6 @@ String::operator=( const char * i_str )
}
void
-String::swap( self & i_rStr )
-{
- const S_Data * pTemp = pd;
- pd = i_rStr.pd;
- i_rStr.pd = pTemp;
-}
-
-void
-String::assign( const self & i_rStr,
- position_type i_nStartPosition,
- size_type i_nLength )
-{
- const S_Data *
- pTemp = new S_Data( str_from_StringOffset(i_rStr, i_nStartPosition),
- i_nLength );
- pd->Release();
- pd = pTemp;
-}
-
-void
-String::assign( const char * i_str )
-{
- const S_Data *
- pTemp = new S_Data( i_str );
- pd->Release();
- pd = pTemp;
-}
-
-void
String::assign( const char * i_str,
size_type i_nLength )
{
@@ -213,18 +175,6 @@ String::assign( const char * i_str,
pd = pTemp;
}
-void
-String::assign( const_iterator i_itBegin,
- const_iterator i_itEnd )
-{
- const S_Data *
- pTemp = new S_Data( i_itBegin,
- size_type(i_itEnd - i_itBegin) );
- pd->Release();
- pd = pTemp;
-}
-
-
int
String::compare( const self & i_rStr ) const
{
@@ -238,55 +188,6 @@ String::compare( const CharOrder_Table & i_rOrder,
return csv::compare( i_rOrder, c_str(), i_rStr.c_str() );
}
-String
-String::substr( position_type i_nStartPosition,
- size_type i_nLength ) const
-{
- size_type nSize = size();
-
- if ( i_nStartPosition < nSize )
- {
- if ( i_nLength == str::maxsize
- OR i_nLength >= nSize - i_nStartPosition )
- return String( c_str() + i_nStartPosition );
- else
- return String( c_str() + i_nStartPosition,
- i_nLength );
- }
-
- return Null_();
-}
-
-String::position_type
-String::find( const char * i_strToSearch,
- position_type i_nSearchStartPosition ) const
-{
- csv_assert(i_strToSearch != 0);
-
- if ( i_nSearchStartPosition < length()
- AND
- *i_strToSearch != '\0' )
- {
- const char * p = strstr(c_str() + i_nSearchStartPosition, i_strToSearch);
- if (p != 0)
- return static_cast<position_type>(p - c_str());
- }
- return str::position(str::npos);
-}
-
-String::position_type
-String::find( char i_charToSearch,
- position_type i_nSearchStartPosition ) const
-{
- if (i_nSearchStartPosition <= length())
- {
- const char * p = strchr(c_str() + i_nSearchStartPosition, i_charToSearch);
- if (p != 0)
- return static_cast<position_type>(p - c_str());
- }
- return str::position(str::npos);
-}
-
const String &
String::Null_()
{