WXP C++ Library Version 6.74.9
|
This class has a set of file tools. More...
#include "../include/FileTool.h"
Static Public Member Functions | |
static bool | isFullPath (const char *filename) |
static int | addPath (const char *path, const char *file, String &filename) |
static int | checkPath (const char *path, const char *file) |
static int | addOutPath (const char *path, const char *file, String &filename) |
static int | numPath (const char *path) |
static int | getPath (const char *path, int ind, String &spath) |
static int | addPathDelim (String &path) |
static int | addUserPath (const char *file, String &filename) |
static bool | exist (const char *file) |
static bool | isStdio (const char *file) |
static bool | isDir (const char *file) |
static bool | isFile (const char *file) |
static bool | isFifo (const char *file) |
static bool | isDevice (const char *file) |
static off_t | getSize (const char *file) |
static int | getModTime (const char *file) |
static int | remove (const char *file) |
static int | makeDir (const char *dir, int flag) |
This class has a set of file tools.
|
static |
Adds a path to the output filename. Won't add path if full path already or special file. File not assumed to exist.
path | Path to add |
file | Filename |
filename | Output filename |
References addPathDelim(), WXP::String::append(), WXP::String::copy(), exist(), WXP::String::get(), getPath(), isFullPath(), isStdio(), numPath(), and WXP::StrLib::valid().
Referenced by WXP::RawPlot::draw(), WXP::GridCont::getDomain(), and WXP::GridVect::getDomain().
|
static |
Adds a path to the filename. Won't add path if full path already or special file. Checks directory list for available file.
path | Path to add |
file | Filename |
filename | Output filename |
References addPathDelim(), WXP::String::append(), WXP::String::copy(), exist(), WXP::String::get(), getPath(), isFullPath(), isStdio(), numPath(), and WXP::StrLib::valid().
Referenced by WXP::MapPlot::draw(), WXP::ProfPlot::draw(), WXP::RedbookPlot::draw(), WXP::UpaXSectCont::draw(), WXP::UpaXSectPlot::draw(), WXP::Region::get(), WXP::ModelName::get(), WXP::CityTool::getFilename(), WXP::Graph::open(), WXP::VarFile::open(), WXP::BufrFile::open(), WXP::WmoIngest::printLog(), WXP::ColorFile::read(), WXP::Unit::readFile(), WXP::WmoIngest::readProdFile(), WXP::VarName::searchFile(), WXP::VarName::searchFile(), WXP::ModelSpec::set(), WXP::NameConv::set(), WXP::CityPlot::setFilename(), WXP::CityPlot::setFilename(), WXP::Graph::setFont(), WXP::Graph::setSymbol(), WXP::RcmDecode::setup(), WXP::CityHash::setup(), WXP::UpaRawinHash::setup(), WXP::CityHash::setup(), and WXP::License::valid().
|
static |
Adds operating system specific path delimiter (/, )
path | Path to add delimiter to, appends to end of path |
References WXP::String::append(), WXP::String::get(), WXP::String::getChar(), and WXP::String::length().
Referenced by addOutPath(), addPath(), checkPath(), and WXP::ResrcFile::open().
|
static |
Adds user path (~user). Check filename to see if user name specified and add user's home directory to path
file | Input filename to check |
filename | Output filename with user name replaced |
References WXP::String::append(), and WXP::String::copy().
Referenced by exist(), getModTime(), getSize(), isDevice(), isDir(), isFifo(), isFile(), WXP::File::open(), and remove().
|
static |
Checks path to the filename. Adds path and checks for existence.
path | Path to add |
file | Filename |
References addPathDelim(), WXP::String::append(), WXP::String::copy(), exist(), WXP::String::get(), getPath(), isFullPath(), isStdio(), numPath(), and WXP::StrLib::valid().
Referenced by WXP::RadPlot::init(), WXP::RcmPlot::init(), and WXP::SatPlot::init().
|
static |
Checks to see if file exists
file | Filename to check |
References addUserPath(), isStdio(), and WXP::Wxp::outDebug().
Referenced by addOutPath(), addPath(), checkPath(), WXP::NameConv::encode(), WXP::Filename::listFile(), WXP::ResrcFile::open(), WXP::Filename::set(), WXP::NameConv::set(), WXP::Filename::setFile(), WXP::Filename::setFile(), and WXP::NameConv::setLatest().
|
static |
Returns the modification time
file | Filename to query |
References addUserPath().
Referenced by WXP::RedbookFile::open().
|
static |
Gets a path from a path list (path:path:...)
path | Path list |
ind | Index of path to get |
spath | Output path |
References WXP::String::clear(), WXP::String::copy(), WXP::StrLib::equal(), and WXP::StrLib::index().
Referenced by addOutPath(), addPath(), checkPath(), WXP::NameConv::encode(), WXP::Filename::listFile(), and WXP::License::valid().
|
static |
Returns the size in bytes of a file
file | Filename to query |
References addUserPath(), and WXP::Wxp::outDebug().
Referenced by WXP::SfcWxpFile::checkType(), WXP::CityFile::open(), WXP::SfcWxpFile::open(), WXP::NameConv::setFile(), and WXP::NameConv::setLatest().
|
static |
Checks to see if file is a device
file | Filename to check |
References addUserPath(), and WXP::StrLib::iequal().
|
static |
Checks to see if file is a directory
file | Filename to check |
References addUserPath().
Referenced by WXP::ResrcFile::open().
|
static |
Checks to see if the file is a FIFO/queue
file | Filename to check |
References addUserPath().
|
static |
|
static |
Returns if filename a full path
Referenced by addOutPath(), addPath(), WXP::Filename::checkFile(), and checkPath().
|
static |
Checks to see if file is standard IO file "-"
file | Filename to check |
References WXP::StrLib::iequal().
Referenced by addOutPath(), addPath(), WXP::Filename::checkFile(), checkPath(), WXP::GridFile::checkType(), exist(), WXP::GridCont::getDomain(), WXP::GridPlot::getDomain(), and WXP::File::open().
|
static |
Create a directory and its subdirectories (recursive create)
dir | Directory to create. |
flag | Number to create (0=create all subdirectories) |
References WXP::StrLib::copy(), WXP::StrLib::length(), and WXP::StrLib::replace().
Referenced by WXP::File::open().
|
static |
Finds the number of valid paths in a multipath string
path | Path to check |
References WXP::StrLib::equal(), and WXP::StrLib::index().
Referenced by addOutPath(), addPath(), checkPath(), WXP::NameConv::encode(), WXP::Filename::listFile(), and WXP::License::valid().
|
static |
Deletes the specified file
file | Filename to delete |
References addUserPath(), and WXP::String::get().