This module provides facilities to manage streams, files and folders. This section allows you to access the C++ source files of the module. This module is part of Bpp/Standard . The files listed below are included in the interface part of the module. So any module dependent of this module is also dependent of the files listed here. The files listed below are needed by the implementation part of the module. But a module dependent of this module is not necessary dependent of the files listed here. <cstdio>
<set>
<bpp/file_name.hpp>
<bpp/modules.hpp>
The namespaces listed below are integrated in this module. That means any element declared in one of those namespaces can now be directly used by or from this module. standardBasicString
standardError
Here are listed the types defined in the module. To use one of them, you have to specify the namespace of the module. type std::ifstream clInFile Input file.
type std::ofstream clOutFile Output file.
type std::istream clInStream Input stream.
type std::ostream clOutStream Output stream.
type std::iostream clStream Input and output stream.
type std_vector(clString) clFileNameS List of file names.
type DIR * tyFolder Represents a folder (in the case that the DIR structure exists).
type FILE_OPENING_MODE_TYPE tyFileMode Opening mode of a file.
type std::streamoff tyStreamOffset Relative position in a stream.
type std::streampos tyStreamPosition Absolute position in a stream.
type std::streamsize tyStreamSize Size in a stream.
enumeration { unknownEntity, fileEntity, folderEntity, referenceEntity } tyDiskEntityKind Symbolic constants for the kinds of entity in a folder.
Here are listed the errors that are supported or generated by the module. To use one of them, you do not have to specify the namespace of the module. erEntityIdentification Can not identify an entity in the folder.
erFileNotRegistered The file is not registered.
erFileOpening Can not open the file.
erFileReading Can not read from the file.
erFileWriting Can not write into the file.
erStreamReading Can not read from the stream.
erStreamWriting Can not write into the stream.
erFindFileSize Can not find the file's size.
erFileAlreadyExists The file already exists.
erFileFolderRenaming Can not rename the file or the folder.
erFileRemoving Can not remove the file.
erFolderClosing Can not close the folder.
erFolderCreation Can not create the folder.
erFolderOpening Can not open the folder.
erFolderRemoving Can not remove the folder.
Here are listed the constants provided by the module. To use one of them, you have to specify the namespace of the module. tcString fileNameSeparator() Symbol that separates file names in a path.
tcString pathSeparator() Symbol that separates paths in an environment variable.
tyCardinal streamBufferSize() Size of the buffer for stream readings and writings.
tyCardinal maximumPathLength() Maximum possible length of a string representing a path.
Here are listed the functions provided by the module. To use one of them, you have to specify the namespace of the module. inline tyBoolean isFileNameSeparator(tyCharacter agCharacter) Checks if a character is a separator for file names.
inline tyBoolean isFileNameSeparator(tcString agString) Checks if a string is a separator for file names.
inline void close(clInFile & agFile) Closes an input file.
inline void close(clOutFile & agFile) Closes an output file.
inline void open(clInFile & agFile,tcString agFileName,tyFileMode agMode) Opens an input file in a given mode.
inline void open(clOutFile & agFile,tcString agFileName,tyFileMode agMode) Opens an output file in a given mode.
inline void getFileList(tcString agFolderName,tcString agFormat,clFileNameS & agFileNameS,tyBoolean agCaseSensitive) Stores the files of a folder into a list. The scanning is not recursive. The matching can be case sensitive.
inline void listFolder(clOutStream & agStream,tcString agFolder,tcString agFormat,tyBoolean agRecursive,tyBoolean agCaseSensitive,tcString agBlankSpace) Lists the content of a folder into a stream. The scanning can be recursive. Only the files matching a given format are listed. The matching can be case sensitive.
function void buildFileName(clString & agName) Makes a string a file name (removes the eventual file name separator at the end of the string).
function void buildFolderName(clString & agName) Makes a string a folder name (adds a file name separator at the end of the string if there is not already one).
function void buildFullName(clString & agFullName,ctString & agPath,ctString & agShortName) Builds a full file name from a path and a short file name.
function void extractShortName(clString & agPath,clString & agShortName,ctString & agFullName) Extracts a short name and a path from a full file name.
function void separateFileName(clString & agBody,clString & agExtension,ctString & agName) Separates a file name into a body string and an extension string.
function void copy(clOutStream & agSout,clInStream & agSin,tyBoolean agBinary) Copies an input stream into an output stream until the input stream ends. The last argument indicates if the output stream is open in binary mode.
function tyBoolean fileExists(tcString agName) Checks if a file exists.
function tyInteger fileSize(tcString agName) Returns the size of a file.
function tyBoolean folderExists(tcString agName) Checks if a folder exists.
tyInteger size(clInFile & lcFile) Returns the size of an open file.
function void changeName(tcString agOldName,tcString agNewName) Changes the name of a file or a folder.
function void createFolder(tcString agName) Creates a new folder.
function void removeFile(tcString agName) Removes a file.
function void removeFolder(tcString agFolderName) Removes a folder and its content.
function void copyFile(tcString agTargetName,tcString agSourceName) Copies the content of a file into another one.
function void copyFolder(tcString agTargetName,tcString agFolderName) Copies the content of a folder into another one.
function void close(tyFolder & agFolder) Closes a folder.
function tcString nextEntity(tyFolder & agFolder) Moves to the next entity of a folder.
function void open(tyFolder & agFolder,tcString agName) Opens a folder.
function tyDiskEntityKind diskEntityKind(tcString agName) Returns the kind of the entity.
function tcString diskEntityKindString(tyDiskEntityKind agKind) Converts an entity kind into a string.
function void scanFolder(tcString agName,clFolderProcessing & agProcessing,tyBoolean agRecursive) Scans a folder and performs a given process upon the entities found in it. The scanning can be recursive.
function void outFileRegister(clOutStream & agStream) Writes into a stream the list of the files still open in the program.
Here are listed the classes provided by the module. To use one of them, you have to specify the namespace of the module. class clFolderProcessing
Used by scanFolder to perform a process upon the entities found during the scanning of a folder. It is an abstract class. The methods of this class must be implemented. | | Copyright (c) 1999-2016 - Bruno Bachelet - bruno@nawouak.net - http://www.nawouak.net | Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. See this license for more details (http://www.gnu.org). |
|
| |