JX Application Framework
|
#include "JError.h"
#include "jTime.h"
#include <stdio.h>
#include "JString.h"
#include "jDirUtil.h"
Functions | |
bool | JFileExists (const JString &fileName) |
bool | JFileReadable (const JString &fileName) |
bool | JFileWritable (const JString &fileName) |
bool | JFileExecutable (const JString &fileName) |
JError | JGetFileLength (const JString &name, JSize *size) |
JString | JPrintFileSize (const JSize size) |
JError | JRenameFile (const JString &oldName, const JString &newName, const bool forceReplace=false) |
JError | JRemoveFile (const JString &fileName) |
bool | JKillFile (const JString &fileName) |
JError | JCreateTempFile (const JString *path, const JString *prefix, JString *fullName) |
JError | JUncompressFile (const JString &origFileName, JString *newFileName, const JString *dirName=nullptr, JProcess **process=nullptr) |
JError | JFOpen (const JString &fileName, const JUtf8Byte *mode, FILE **stream) |
void | JExtractFileAndLine (const JString &str, JString *fileName, JIndex *startLineIndex, JIndex *endLineIndex=nullptr) |
JString | JCombineRootAndSuffix (const JString &root, const JUtf8Byte *suffix) |
JString | JCombineRootAndSuffix (const JString &root, const JString &suffix) |
bool | JSplitRootAndSuffix (const JString &name, JString *root, JString *suffix) |
JString | JFileNameToURL (const JString &fileName) |
bool | JURLToFileName (const JString &url, JString *fileName) |
JError | JCreateTempFile (JString *fullName) |
Combines the root and suffix with a period between them.
Creates a unique file in the specified directory. If path is empty, it uses the system's scratch directory. If prefix is empty, uses temp_file_.
void JExtractFileAndLine | ( | const JString & | str, |
JString * | fileName, | ||
JIndex * | startLineIndex, | ||
JIndex * | endLineIndex = nullptr |
||
) |
Returns true if the specified file can be executed.
Readability is not checked, because this is only an issue for scripts, and I can't tell the difference between a script and a binary.
JURLToFileName() does not accept URLs without a host name because the whole point of using URLs is that one doesn't know if the source and target machines will be the same.
Returns true if the specified file can be written to.
Wrapper for fopen() that returns JError.
Sets *size to the the length of the specified file. Can return JDirEntryDoesNotExist.
Tries as hard as it can to delete the file. Returns true if successful.
Converts the given file size into a string with a reasonable precision. e.g. 1003280 -> 1MB
Removes the specified file.
Can return JSegFault, JAccessDenied, JNameTooLong, JBadPath, JComponentNotDirectory, JTriedToRemoveDirectory, JNoKernelMemory, JFileSystemReadOnly.
Renames the specified file.
JError JUncompressFile | ( | const JString & | origFileName, |
JString * | newFileName, | ||
const JString * | dirName = nullptr , |
||
JProcess ** | process = nullptr |
||
) |