B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
System::File Class Reference

An representation of file and directory pathnames. More...

#include <File.h>

Static Public Member Functions

static int chsize (FILE *fd, long length)
 Changes file size. More...
 
static int chsize64 (FILE *fd, long long length)
 
static void createEmpty (const std::string &path)
 Creates new empty file. More...
 
static std::string createUniqueName (const std::string &prefix, const std::string &ext)
 
static void deleteFile (const std::string &fileName)
 Deletes an existing file. More...
 
static bool doesExist (const std::string &path)
 Checks if the given file already exists. More...
 
static std::string getCurrentDirectory ()
 Returns current directory path. More...
 
static long getNameMax (const std::string &path)
 Returns the maximum number of bytes in the given filename. More...
 
static bool isAbsolutePath (const std::string &path)
 Checks if the given file path is an absolute one. More...
 
static void moveFile (const std::string &existingFileName, const std::string &newFileName)
 Moves an existing file. More...
 
static void setFlags (int aFd, int aFlags)
 Sets the given file's flags. More...
 
static void setOFileToMax ()
 Sets the maximum number of open files per process to the maximum value. More...
 
static void split (std::string const &fullFileName, std::string *fileName, std::string *extention)
 Splits full file name into file name and extention. More...
 

Detailed Description

An representation of file and directory pathnames.

Member Function Documentation

static int System::File::chsize ( FILE *  fd,
long  length 
)
static

Changes file size.

Parameters
fdFile descriptor. Must be not NULL.
lengthNew file length.
Returns
Upon successful completion shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.
Exceptions
System::Exceptionif input parameters are incorrect.
static int System::File::chsize64 ( FILE *  fd,
long long  length 
)
static
static void System::File::createEmpty ( const std::string &  path)
static

Creates new empty file.

static std::string System::File::createUniqueName ( const std::string &  prefix,
const std::string &  ext 
)
static
static void System::File::deleteFile ( const std::string &  fileName)
static

Deletes an existing file.

Exceptions
SystemException

Referenced by CmiProductCatalog::saveToFile().

static bool System::File::doesExist ( const std::string &  path)
static

Checks if the given file already exists.

Returns
true if so, otherwise false.

Referenced by FixProtocols::loadProtocolFile().

static std::string System::File::getCurrentDirectory ( )
static

Returns current directory path.

static long System::File::getNameMax ( const std::string &  path)
static

Returns the maximum number of bytes in the given filename.

Exceptions
SystemException
static bool System::File::isAbsolutePath ( const std::string &  path)
static

Checks if the given file path is an absolute one.

Note
does not check if the file exists.
Returns
true if so, otherwise false.

Referenced by FixProtocols::loadProtocolFile().

static void System::File::moveFile ( const std::string &  existingFileName,
const std::string &  newFileName 
)
static

Moves an existing file.

Exceptions
SystemException

Referenced by CmiProductCatalog::saveToFile().

static void System::File::setFlags ( int  aFd,
int  aFlags 
)
static

Sets the given file's flags.

Parameters
aFdan open file descriptor.
aFlagsfile status flags to turn on.
static void System::File::setOFileToMax ( )
static

Sets the maximum number of open files per process to the maximum value.

Exceptions
SystemException
static void System::File::split ( std::string const &  fullFileName,
std::string *  fileName,
std::string *  extention 
)
static

Splits full file name into file name and extention.

Extention part will contain "." (dot) character.