![]() |
Provides accessories to read and write different types of structured files. More...
#include <FileTool.h>
Static Public Member Functions | |
static int | store (ostream &pOutputRef, StringDictionary &pDictRef) |
Stores the specified dictionary into the provided stream, so it can be recovered calling the "retrieve" method. | |
static bool | retrieve (StringDictionary &pDictRef, istream &pInputRef) |
Recovers a dictionary from the specified stream. | |
static int | store (ostream &pOutputRef, StringArray &pArrayRef) |
Stores the specified array into the provided stream, so it can be recovered calling the "retrieve" method. | |
static bool | retrieve (StringArray &pArrayRef, istream &pInputRef) |
Recovers an array from the specified stream. | |
Provides accessories to read and write different types of structured files.
Definition at line 37 of file FileTool.h.
|
static |
Recovers a dictionary from the specified stream.
The stream format follows the pattern:
key=value key=value
The empty lines or the ones start with the # character, won't be taken into consideration.
pDictRef | |
pInputRef |
Definition at line 56 of file FileTool.cpp.
References HSEP::Dictionary< T >::clear(), HSEP::StringTool::drop(), HSEP::StringTool::ltrim(), and HSEP::Dictionary< T >::put().
|
static |
Recovers an array from the specified stream.
Each line is recovered as a different Array string element.
pArrayRef | |
pInputRef |
Definition at line 102 of file FileTool.cpp.
References HSEP::Array< T >::clear(), HSEP::StringTool::drop(), HSEP::StringTool::ltrim(), and HSEP::Array< T >::push().
|
static |
Stores the specified dictionary into the provided stream, so it can be recovered calling the "retrieve" method.
The content on the stream will follow the pattern:
key=value key=value
pOutputRef | |
pDictRef |
Definition at line 42 of file FileTool.cpp.
References HSEP::Dictionary< T >::forEach().
|
static |
Stores the specified array into the provided stream, so it can be recovered calling the "retrieve" method.
Each element is send as a different line to the stream.
pOutputRef | |
pArrayRef |
Definition at line 89 of file FileTool.cpp.
References HSEP::Array< T >::forEach().