C++ main module for gpm Package  1.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
CORE_IO Class Reference

this class describes the IO class More...

#include <CORE_IO.h>

Inheritance diagram for CORE_IO:
Inheritance graph
[legend]
Collaboration diagram for CORE_IO:
Collaboration graph
[legend]

Public Member Functions

void getSharedPointer (SP::CORE_Object &p)
 get the shared pointer of this class into p More...
 
void getSharedPointer (SPC::CORE_Object &p) const
 get the shared pointer of this class into p More...
 
tString getClassName () const
 return the class name of the object More...
 
tString getIdentityString () const
 return the identity string of the object of the form className_at_address More...
 
tString getPointerAddress () const
 return the identity string of the object More...
 
template<class T >
tBoolean isInstanceOf () const
 return true if the object is an instance of T More...
 
virtual tString toString () const
 return the string representation of the object node More...
 
virtual void print ()
 print the class More...
 
virtual ostream & print (ostream &out) const
 print the class More...
 
virtual void print (const tString &message)
 print the class More...
 
virtual void print (const tInteger &str)
 print More...
 
virtual void print (const tRelativeInteger &str)
 print More...
 
virtual void print (const tReal &str)
 print More...
 
virtual void print (const int &str)
 print More...
 

Static Public Member Functions

static SP::CORE_IO New ()
 create a new CORE_Io class More...
 
static tBoolean exists (const tString &filename)
 test if the file or path exists More...
 
static tBoolean isPath (const tString &file)
 test if the file is a path More...
 
static tBoolean isFile (const tString &file)
 test if the file is a regular file More...
 
static tBoolean removeFile (const tString &filename)
 remove the file More...
 
static tBoolean removePath (const tString &path)
 remove the path if and only if the path is empty More...
 
static tBoolean removeDirectory (const tString &path)
 remove the path if and only if the path is empty More...
 
static tBoolean removePath (const tString &path, const tBoolean &removeOnlyEmptyDir)
 remove the path More...
 
static tBoolean removeDirectory (const tString &path, const tBoolean &removeOnlyEmptyDir)
 remove the path More...
 
static tBoolean createPath (const tString &path)
 create the path return false if the path does not exists More...
 
static tBoolean createDirectory (const tString &path)
 create the path return false if the path does not exists More...
 
static void getPathAndFileName (const tString &file, tString &path, tString &fileName)
 get the path and file name More...
 
static tString getExtension (const tString &file)
 get the extension toto.html => html More...
 
static tString getPrefix (const tString &file)
 get the prefix ie all the name before the last . More...
 
static tString getBasename (const tString &file)
 get the base nname of the file More...
 
static void setExtension (tString &file, const tString &ext)
 set the extension More...
 
static tBoolean getFiles (const tString &path, const tString &filter, CORE_StringArray &files)
 get all files in path with filter in files vector More...
 
static tBoolean getFiles (const tString &path, const tString &filter, vector< tString > &files)
 get all files in path with filter in files vector More...
 
static tBoolean cp (const tString &src, const tString &dest)
 copy file More...
 
static tBoolean mv (const tString &src, const tString &dest)
 move file More...
 
static tBoolean getContents (const tString &path, CORE_StringArray &files)
 get all contents of path More...
 
static tString getCurrentPath ()
 get the current path More...
 
static void getPaths (const tString &rootPath, CORE_StringArray &paths)
 get the all the paths of the root path More...
 
static void beginRedirectOutputToFile (const tString &fn)
 redirection of the output to file More...
 
static void beginRedirectOutputToString ()
 redirection of the output to string More...
 
static void endRedirectOutput (tString &message)
 end of redirection of the output to file More...
 
static tString getClassName (const tString &identityString)
 return the class name of the object using only the identity string More...
 
template<class T >
static tString getTypeName ()
 get type name More...
 
static tBoolean is64Architecture ()
 return true if the machine is a 64 bits machine More...
 
static tBoolean is32Architecture ()
 return true if the machine is a 32 bits machine More...
 
static tString pointer2String (const void *obj)
 return the string represantation of a pointer More...
 
static void setOutput (ostream &out)
 set output More...
 
static ostream & getOutput ()
 get output More...
 
static void printObjectsInMemory ()
 print object in memory More...
 
static ostream & print (ostream &out, const tString &message)
 print the class More...
 
static void outputPrint (const tString &message)
 

Static Public Attributes

static tBoolean mIsMemoryTesting =false
 indicator to store all classes created and deleted only for debuging version More...
 

Protected Member Functions

 CORE_IO ()
 build a CORE_IO More...
 
virtual ~CORE_IO (void)
 destroy a CORE_IO More...
 
void setThis (SP::CORE_Object p)
 set this weak shared pointer called toDoAfterThis setting method More...
 
virtual void setType (tString type)
 set the type of the object More...
 
virtual void toDoAfterThisSetting ()
 method called after setThis() method this method can oly be called once. More...
 

Detailed Description

this class describes the IO class

Constructor & Destructor Documentation

CORE_IO::CORE_IO ( )
protected

build a CORE_IO

References CORE_Object::setType().

Referenced by New().

Here is the call graph for this function:

Here is the caller graph for this function:

CORE_IO::~CORE_IO ( void  )
protectedvirtual

destroy a CORE_IO

Member Function Documentation

void CORE_IO::beginRedirectOutputToFile ( const tString fn)
static

redirection of the output to file

redirect the output

void CORE_IO::beginRedirectOutputToString ( )
static

redirection of the output to string

redirect the output

tBoolean CORE_IO::cp ( const tString src,
const tString dest 
)
static

copy file

References exists(), and tBoolean.

Here is the call graph for this function:

tBoolean CORE_IO::createDirectory ( const tString path)
static

create the path return false if the path does not exists

References exists().

Referenced by createPath(), and testIO().

Here is the call graph for this function:

Here is the caller graph for this function:

static tBoolean CORE_IO::createPath ( const tString path)
inlinestatic

create the path return false if the path does not exists

References createDirectory().

Here is the call graph for this function:

void CORE_IO::endRedirectOutput ( tString message)
static

end of redirection of the output to file

redirect the output

References null.

tBoolean CORE_IO::exists ( const tString filename)
static

test if the file or path exists

Referenced by cp(), createDirectory(), getContents(), getFiles(), CORE_CommandLine::interpretCommandLine(), isFile(), isPath(), mv(), removeDirectory(), removeFile(), GPM_CoreTest::searchPath(), and testIO().

Here is the caller graph for this function:

tString CORE_IO::getBasename ( const tString file)
static

get the base nname of the file

Referenced by testIO().

Here is the caller graph for this function:

static tString CORE_Object::getClassName ( const tString identityString)
inlinestaticinherited

return the class name of the object using only the identity string

Referenced by CORE_Object::printObjectsInMemory().

Here is the caller graph for this function:

tString CORE_Object::getClassName ( ) const
inherited

return the class name of the object

Returns
the class name of the object

References tString.

Referenced by CORE_Object::getIdentityString().

Here is the caller graph for this function:

tBoolean CORE_IO::getContents ( const tString path,
CORE_StringArray files 
)
static

get all contents of path

Parameters
pathpath to get the files
filesreturn content names
Returns
true if the path exists

References CORE_Array< T >::add(), CORE_Array< T >::clear(), exists(), and tString.

Referenced by getPaths().

Here is the call graph for this function:

Here is the caller graph for this function:

tString CORE_IO::getCurrentPath ( )
static

get the current path

Referenced by testIO().

Here is the caller graph for this function:

tString CORE_IO::getExtension ( const tString file)
static

get the extension toto.html => html

References tString.

Referenced by getFiles(), and testIO().

Here is the caller graph for this function:

tBoolean CORE_IO::getFiles ( const tString path,
const tString filter,
CORE_StringArray files 
)
static

get all files in path with filter in files vector

Parameters
pathpath to get the files
filterfilter of files sting looks like like "txt","csv",....
filesreturn file names
Returns
true if the path exists

References CORE_Array< T >::add(), CORE_Array< T >::clear(), exists(), getExtension(), CORE_Array< T >::getSize(), CORE_String::New(), CORE_Array< T >::removeAtIndex(), CORE_Array< T >::sort(), tBoolean, and tString.

Referenced by testIO(), and testListFiles().

Here is the call graph for this function:

Here is the caller graph for this function:

tBoolean CORE_IO::getFiles ( const tString path,
const tString filter,
vector< tString > &  files 
)
static

get all files in path with filter in files vector

Parameters
pathpath to get the files
filterfilter of files sting looks like like "txt","csv",....
filesreturn file names
Returns
true if the path exists

References exists(), getExtension(), CORE_String::New(), CORE_Vector< T >::sort(), tBoolean, and tString.

Here is the call graph for this function:

tString CORE_Object::getIdentityString ( ) const
inlineinherited

return the identity string of the object of the form className_at_address

Returns
the identity string of the object

References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.

Referenced by CORE_Object::toString().

Here is the call graph for this function:

Here is the caller graph for this function:

static ostream& CORE_Object::getOutput ( )
inlinestaticinherited

get output

void CORE_IO::getPathAndFileName ( const tString file,
tString path,
tString fileName 
)
static

get the path and file name

Referenced by mv(), GPMG_Project::run(), setExtension(), and testIO().

Here is the caller graph for this function:

void CORE_IO::getPaths ( const tString rootPath,
CORE_StringArray paths 
)
static

get the all the paths of the root path

References CORE_Array< T >::add(), getContents(), CORE_Array< T >::getSize(), isPath(), and tString.

Here is the call graph for this function:

tString CORE_Object::getPointerAddress ( ) const
inlineinherited

return the identity string of the object

Returns
the identity string of the object

References CORE_Object::pointer2String().

Here is the call graph for this function:

tString CORE_IO::getPrefix ( const tString file)
static

get the prefix ie all the name before the last .

References tString.

Referenced by testIO().

Here is the caller graph for this function:

void CORE_Object::getSharedPointer ( SP::CORE_Object &  p)
inlineinherited
void CORE_Object::getSharedPointer ( SPC::CORE_Object &  p) const
inlineinherited

get the shared pointer of this class into p

template<class T >
static tString CORE_Object::getTypeName ( )
inlinestaticinherited

get type name

References tString.

static tBoolean CORE_Object::is32Architecture ( )
inlinestaticinherited

return true if the machine is a 32 bits machine

References CORE_Object::is64Architecture().

Here is the call graph for this function:

tBoolean CORE_Object::is64Architecture ( )
staticinherited

return true if the machine is a 64 bits machine

Referenced by CORE_Object::is32Architecture().

Here is the caller graph for this function:

tBoolean CORE_IO::isFile ( const tString file)
static

test if the file is a regular file

References exists(), and tBoolean.

Referenced by GPMG_Application::loadModelFile(), and testIO().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

return true if the object is an instance of T

References null.

Referenced by MATH_BinaryOperator::insertInTree(), MATH_UnaryOperator::insertInTree(), and MATH_EndBlock::insertInTree().

Here is the caller graph for this function:

tBoolean CORE_IO::isPath ( const tString file)
static

test if the file is a path

References exists().

Referenced by getPaths(), mv(), and testIO().

Here is the call graph for this function:

Here is the caller graph for this function:

tBoolean CORE_IO::mv ( const tString src,
const tString dest 
)
static

move file

References exists(), getPathAndFileName(), isPath(), tBoolean, and tString.

Here is the call graph for this function:

static SP::CORE_IO CORE_IO::New ( )
inlinestatic

create a new CORE_Io class

References CORE_IO().

Here is the call graph for this function:

void CORE_Object::outputPrint ( const tString message)
staticinherited

print on output

References null, and CORE_Object::print().

Referenced by CORE_Exception::CORE_Exception().

Here is the call graph for this function:

Here is the caller graph for this function:

tString CORE_Object::pointer2String ( const void *  obj)
staticinherited

return the string represantation of a pointer

References tString.

Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().

Here is the caller graph for this function:

virtual void CORE_Object::print ( )
inlinevirtualinherited

print the class

References CORE_Object::toString().

Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ostream& CORE_Object::print ( ostream &  out) const
inlinevirtualinherited

print the class

References CORE_Object::print(), and CORE_Object::toString().

Here is the call graph for this function:

void CORE_Object::print ( const tString message)
virtualinherited

print the class

Reimplemented in CORE_Out.

References null, and CORE_Object::print().

Here is the call graph for this function:

void CORE_Object::print ( const tInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tRelativeInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tReal str)
virtualinherited

print

References null.

void CORE_Object::print ( const int &  str)
virtualinherited

print

References null.

static ostream& CORE_Object::print ( ostream &  out,
const tString message 
)
inlinestaticinherited

print the class

void CORE_Object::printObjectsInMemory ( )
staticinherited

print object in memory

References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static tBoolean CORE_IO::removeDirectory ( const tString path)
inlinestatic

remove the path if and only if the path is empty

Returns
true if the path does not exist after this method calling

Referenced by removePath(), and testIO().

Here is the caller graph for this function:

tBoolean CORE_IO::removeDirectory ( const tString path,
const tBoolean removeOnlyEmptyDir 
)
static

remove the path

Returns
true if the path does not exist after this method calling

References exists().

Here is the call graph for this function:

tBoolean CORE_IO::removeFile ( const tString filename)
static

remove the file

References exists().

Referenced by CORE_CommandLine::interpretCommandLine().

Here is the call graph for this function:

Here is the caller graph for this function:

static tBoolean CORE_IO::removePath ( const tString path)
inlinestatic

remove the path if and only if the path is empty

Returns
true if the path does not exist after this method calling

References removeDirectory().

Referenced by testIO().

Here is the call graph for this function:

Here is the caller graph for this function:

static tBoolean CORE_IO::removePath ( const tString path,
const tBoolean removeOnlyEmptyDir 
)
inlinestatic

remove the path

Returns
true if the path does not exist after this method calling

References removeDirectory().

Here is the call graph for this function:

void CORE_IO::setExtension ( tString file,
const tString ext 
)
static

set the extension

References getPathAndFileName(), and tString.

Here is the call graph for this function:

static void CORE_Object::setOutput ( ostream &  out)
inlinestaticinherited

set output

void CORE_Object::setThis ( SP::CORE_Object  p)
inlineprotectedinherited

set this weak shared pointer called toDoAfterThis setting method

References CORE_Object::toDoAfterThisSetting().

Here is the call graph for this function:

virtual void CORE_Object::setType ( tString  type)
inlineprotectedvirtualinherited
virtual void CORE_Object::toDoAfterThisSetting ( )
inlineprotectedvirtualinherited
tString CORE_Object::toString ( ) const
virtualinherited

Member Data Documentation

tBoolean CORE_Object::mIsMemoryTesting =false
staticinherited

indicator to store all classes created and deleted only for debuging version

Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().


The documentation for this class was generated from the following files: