JX Application Framework
Loading...
Searching...
No Matches
Functions
jFileUtil.cpp File Reference
#include "jFileUtil.h"
#include "jStreamUtil.h"
#include "jFStreamUtil.h"
#include "JStringIterator.h"
#include "JStringMatch.h"
#include "JRegex.h"
#include "jMountUtil.h"
#include "jSysUtil.h"
#include "jErrno.h"
#include <limits.h>
#include "jAssert.h"
Include dependency graph for jFileUtil.cpp:

Functions

JError JRenameFile (const JString &oldName, const JString &newName, const bool forceReplace)
 
JString JCombinePathAndName (const JString &path, const JString &name)
 
bool JSplitPathAndName (const JString &fullName, JString *path, JString *name)
 
void JAppendDirSeparator (JString *dirName)
 
JString JPrintFileSize (const JSize size)
 
void JExtractFileAndLine (const JString &str, JString *fileName, JIndex *startLineIndex, JIndex *endLineIndex)
 
JString JCombineRootAndSuffix (const JString &root, const JUtf8Byte *suffix)
 
bool JSplitRootAndSuffix (const JString &name, JString *root, JString *suffix)
 
JString JFileNameToURL (const JString &fileName)
 
bool JURLToFileName (const JString &url, JString *fileName)
 
JError JFOpen (const JString &fileName, const JUtf8Byte *mode, FILE **stream)
 

Function Documentation

◆ JAppendDirSeparator()

void JAppendDirSeparator ( JString dirName)

Appends the appropriate separator to the end of *dirName, if neccessary.

◆ JCombinePathAndName()

JString JCombinePathAndName ( const JString path,
const JString name 
)

Concatenates path and name, inserting the appropriate separator if necessary.

◆ JCombineRootAndSuffix()

JString JCombineRootAndSuffix ( const JString root,
const JUtf8Byte suffix 
)

Combines the root and suffix with a period between them.

◆ JExtractFileAndLine()

void JExtractFileAndLine ( const JString str,
JString fileName,
JIndex startLineIndex,
JIndex endLineIndex 
)

◆ JFileNameToURL()

JString JFileNameToURL ( const JString fileName)

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.

◆ JFOpen()

JError JFOpen ( const JString fileName,
const JUtf8Byte mode,
FILE **  stream 
)

Wrapper for fopen() that returns JError.

◆ JPrintFileSize()

JString JPrintFileSize ( const JSize  size)

Converts the given file size into a string with a reasonable precision. e.g. 1003280 -> 1MB

◆ JRenameFile()

JError JRenameFile ( const JString oldName,
const JString newName,
const bool  forceReplace 
)

Renames the specified file.

◆ JSplitPathAndName()

bool JSplitPathAndName ( const JString fullName,
JString path,
JString name 
)

Splits fullName into a path and name.

If fullName doesn't contain a directory separator, it returns false and *path is the result of JGetCurrentDirectory().

◆ JSplitRootAndSuffix()

bool JSplitRootAndSuffix ( const JString name,
JString root,
JString suffix 
)

◆ JURLToFileName()

bool JURLToFileName ( const JString url,
JString fileName 
)