JX Application Framework
|
#include "jFStreamUtil.h"
#include "jStreamUtil.h"
#include "jFileUtil.h"
#include "JString.h"
#include <stdio.h>
#include "jAssert.h"
Functions | |
void | JReadFile (const JString &fileName, JString *str) |
void | JReadFile (std::ifstream &input, JString *str) |
void | JReadFile (std::fstream &input, JString *str) |
JSize | JGetFStreamLength (std::ifstream &theStream) |
JSize | JGetFStreamLength (std::fstream &theStream) |
bool | JConvertToStream (const int input, std::ifstream *input2, JString *tempFullName, const bool closeInput) |
bool JConvertToStream | ( | const int | input, |
std::ifstream * | input2, | ||
JString * | tempFullName, | ||
const bool | closeInput | ||
) |
Convert the data from the given file descriptor into an std::ifstream. The location of the file is returned in tempFullName.
This would be unnecessary if libstdc++ provided a stream wrapper for arbitrary file descriptors.
JSize JGetFStreamLength | ( | std::fstream & | theStream | ) |
JSize JGetFStreamLength | ( | std::ifstream & | theStream | ) |
Returns the length of the file associated with theStream.
Read characters from the std::fstream until the end of the file is reached. These functions takes a JString* because the contents of the file could be very large, and returning a JString requires twice as much memory because of the copy constructor.
These are equivalent to JReadAll() in jStreamUtil.h, except that they are optimized to work with file streams.
void JReadFile | ( | std::fstream & | input, |
JString * | str | ||
) |
void JReadFile | ( | std::ifstream & | input, |
JString * | str | ||
) |