Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
Functions
Lucene::FileUtils Namespace Reference

## Functions

LPPAPI bool | fileExists (const String &path)
| Return true if given file or directory exists.
LPPAPI uint64_t | fileModified (const String &path)
| Return file last modified date and time.
LPPAPI bool | touchFile (const String &path)
| Set file last modified date and time to now.
LPPAPI int64_t | fileLength (const String &path)
| Return file length in bytes.
LPPAPI bool | setFileLength (const String &path, int64_t length)
| Set new file length, truncating or expanding as required.
LPPAPI bool | removeFile (const String &path)
| Delete file from file system.
LPPAPI bool | copyFile (const String &source, const String &dest)
| Copy a file to/from file system.
LPPAPI bool | createDirectory (const String &path)
| Create new directory under given location.
LPPAPI bool | removeDirectory (const String &path)
| Delete directory from file system.
LPPAPI bool | isDirectory (const String &path)
| Return true if given path points to a directory.
LPPAPI bool | listDirectory (const String &path, bool filesOnly, HashSet< String > dirList)
| Return list of files (and/or directories) under given directory.
LPPAPI bool | copyDirectory (const String &source, const String &dest)
| Copy a directory to/from file system.
LPPAPI String | joinPath (const String &path, const String &file)
| Return complete path after joining given directory and file name.
LPPAPI String | extractPath (const String &path)
| Extract parent path from given path.
LPPAPI String | extractFile (const String &path)
| Extract file name from given path.

## Function Documentation

## ◆ copyDirectory()

LPPAPI bool Lucene::FileUtils::copyDirectory | ( | const String & | source,
|  | const String & | dest )

Copy a directory to/from file system.

## ◆ copyFile()

LPPAPI bool Lucene::FileUtils::copyFile | ( | const String & | source,
|  | const String & | dest )

Copy a file to/from file system.

## ◆ createDirectory()

LPPAPI bool Lucene::FileUtils::createDirectory | ( | const String & | path | ) |

Create new directory under given location.

## ◆ extractFile()

LPPAPI String Lucene::FileUtils::extractFile | ( | const String & | path | ) |

Extract file name from given path.

## ◆ extractPath()

LPPAPI String Lucene::FileUtils::extractPath | ( | const String & | path | ) |

Extract parent path from given path.

## ◆ fileExists()

LPPAPI bool Lucene::FileUtils::fileExists | ( | const String & | path | ) |

Return true if given file or directory exists.

## ◆ fileLength()

LPPAPI int64_t Lucene::FileUtils::fileLength | ( | const String & | path | ) |

Return file length in bytes.

## ◆ fileModified()

LPPAPI uint64_t Lucene::FileUtils::fileModified | ( | const String & | path | ) |

Return file last modified date and time.

## ◆ isDirectory()

LPPAPI bool Lucene::FileUtils::isDirectory | ( | const String & | path | ) |

Return true if given path points to a directory.

## ◆ joinPath()

LPPAPI String Lucene::FileUtils::joinPath | ( | const String & | path,
|  | const String & | file )

Return complete path after joining given directory and file name.

## ◆ listDirectory()

LPPAPI bool Lucene::FileUtils::listDirectory | ( | const String & | path,
|  | bool | filesOnly,
|  | HashSet< String > | dirList )

Return list of files (and/or directories) under given directory.

Parameters

  path | path to list directory.
  filesOnly | if true the exclude sub-directories.
  dirList | list of files to return.

## ◆ removeDirectory()

LPPAPI bool Lucene::FileUtils::removeDirectory | ( | const String & | path | ) |

Delete directory from file system.

## ◆ removeFile()

LPPAPI bool Lucene::FileUtils::removeFile | ( | const String & | path | ) |

Delete file from file system.

## ◆ setFileLength()

LPPAPI bool Lucene::FileUtils::setFileLength | ( | const String & | path,
|  | int64_t | length )

Set new file length, truncating or expanding as required.

## ◆ touchFile()

LPPAPI bool Lucene::FileUtils::touchFile | ( | const String & | path | ) |

Set file last modified date and time to now.

clucene.sourceforge.net