neo::file Namespace Reference


Detailed Description

The file engine sub-namespace holds the classes for a virtual file system and stream-based I/O classes. The virtual file system manages real files and files in packages (archives) through codecs. Streams provide abstraction for endianess issues and text/binary modes.


Classes

class  EndOfBitStreamException
 Exception when bitstream reaches end-of-stream. More...
class  BitStream
 Wrapper for bitwise I/O to a stream. More...
class  BufferStreamBuf
 Stream buffer implementation for memory buffer streams. More...
class  BufferStream
 Memory buffer stream. More...
class  MSVCDebugStream
 Output stream to MSVC++ debugger. More...
class  Directory
 View of directory in virtual file system. More...
class  FileNotFoundException
 Exception thrown when a requested file was not found. More...
class  InvalidFileFormatException
 Exception thrown when reading a file with invalid format/data. More...
class  InvalidPackageException
 Exception thrown when trying to mount an invalid package. More...
class  File
 File stream. More...
class  FileSystem
 Virtual file system. More...
class  IOStream
 Input/output stream. More...
class  IStream
 Input stream. More...
class  MemoryMap
 MappedFile object. More...
class  OStream
 Output stream. More...
class  Package
 Package file. More...
class  PackageCodec
 Package codec. More...
class  PackageNetworkProtocol
 Package loading over a network protocol. More...
class  PackageNetworkCallback
 Callback for network package downloading. More...
class  COut
 cout wrapper More...
class  CErr
 cerr wrapper More...
class  CIn
 cin wrapper More...
class  StreamBase
 Base for all engine stream objects. More...

Enumerations

enum  Mode
 Open modes. More...
enum  SeekDir
 Seek directions. More...

Functions

std::string extractBaseFileName (const std::string &path)
 Get base file name.
std::string extractBaseFileNameWithPath (const std::string &path)
 Get base file name with path.
std::string extractFileExtension (const std::string &path)
 Get file extension.
std::string extractFileName (const std::string &path)
 Get file name.
std::string extractPathName (const std::string &path)
 Get path.
std::string extractProtocol (const std::string &uri)
 Get network protocol.
std::string mergePaths (const std::string &first, const std::string &second)
 Merge paths.
std::string cleanPath (const std::string &path, bool absolute=true, bool appendSeparator=false)
 Clean path.
bool isAbsolutePath (const std::string &path)
 Check if path is absolute.
std::string makeAbsolutePath (const std::string &path)
 Make real filesystem path absolute.
std::string convertRealPathToVirtual (const std::string &path)
 Convert a real filesystem path to virtual file system.


Enumeration Type Documentation

enum neo::file::Mode

Open modes for streams. For a complete reference on the effect of the various combinations of modes, see your STL reference. The engine modes match the std modes.

enum neo::file::SeekDir

Seek directions


Function Documentation

std::string neo::file::extractBaseFileName ( const std::string &  path  ) 

Get base file name (no path and no extension) from full path name

Parameters:
path Full path
Returns:
File base name

std::string neo::file::extractBaseFileNameWithPath ( const std::string &  path  ) 

Get base file name with path (no extension) from full path name

Parameters:
path Full path
Returns:
File base name with path

std::string neo::file::extractFileExtension ( const std::string &  path  ) 

Get file extension (string after last dot) from full path name, not including the dot.

Parameters:
path Full path
Returns:
File extension

std::string neo::file::extractFileName ( const std::string &  path  ) 

Get file name (no path but with extension) from full path name

Parameters:
path Full path
Returns:
File full name

std::string neo::file::extractPathName ( const std::string &  path  ) 

Get path name from full path name

Parameters:
path Full path
Returns:
Path name

std::string neo::file::extractProtocol ( const std::string &  uri  ) 

Get network protocol from full URI (for example, "http://foo.com/some.file" will return "http")

Parameters:
uri URI
Returns:
Protocol

std::string neo::file::mergePaths ( const std::string &  first,
const std::string &  second 
)

Merge and cleanup paths

Parameters:
first First path
second Second path
Returns:
Path that is merged path, first + second

std::string neo::file::cleanPath ( const std::string &  path,
bool  absolute = true,
bool  appendSeparator = false 
)

Clean path by replacing windows backslash with slash and cleaning up multiple concurrent slashes. Any slash characters at end of path will be removed as well. This method recognizes network protocol separator and will only clean file path part of such URI:s. Furthermore, any parts of the path of type "/./" will be condensed to "/".

Parameters:
path Path string
absolute Flag indicating absolute path. If true (default) a slash will be inserted at start of path if missing, if false any existing leading slashes will be removed
appendSeparator If true, a directory separator will be appended at end of path if not already there. Default is false.
Returns:
Cleaned path string

bool neo::file::isAbsolutePath ( const std::string &  path  ) 

Check if path is absolute. An absolute path is either an URI or a file path that starts with a directory separator or a volume identificator

Parameters:
path Path
Returns:
true if path is absolute, false if not

std::string neo::file::makeAbsolutePath ( const std::string &  path  ) 

Make the path in real filesystem absolute by prepending the current working directory if the path is relative, and cleaning out ".." and "." directories. Returns empty string if error (invalid path).

Parameters:
path Path
Returns:
Absolute path, empty string if error

std::string neo::file::convertRealPathToVirtual ( const std::string &  path  ) 

Convert a real filesystem path to virtual file system. If the given path is outside the virtual file system or the path is invalid, an empty string is returned. If the real filesystem path is a relative path, the current working directory is used to convert it to an absolute path (the path can contain ".." and "." directories).

Parameters:
path Real filesystem path
Returns:
Absolute path in virtual file system, empty if error


Generated on Sat Feb 17 20:51:05 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1