WXP C++ Library Version 6.74.9
|
This class reads resource values in from a file. More...
#include "../include/ResrcFile.h"
Public Member Functions | |
ResrcFile () | |
ResrcFile (Resrc &resrc) | |
ResrcFile (Resrc &resrc, const char *filename) | |
~ResrcFile () | |
bool | isOpen () |
int | init () |
int | set (Resrc &resrc) |
int | set (const char *rprog, const char *rname) |
int | setTag (const char *str) |
int | clearTag () |
int | open (const char *fname) |
int | close () |
int | get (String &resrc, String &value) |
int | getValid (String &resrc, String &value) |
int | compare (const char *resrc, const char *string) |
int | valid (const char *string) |
int | readFile (Resrc &resrc, const char *filename) |
Static Public Member Functions | |
static int | parseName (const char *str, String &resrc) |
This class reads resource values in from a file.
ResrcFile::ResrcFile | ( | ) |
Constructor. Initializes class values
References init().
ResrcFile::ResrcFile | ( | Resrc & | resrc | ) |
ResrcFile::ResrcFile | ( | Resrc & | resrc, |
const char * | file | ||
) |
ResrcFile::~ResrcFile | ( | ) |
Destructor. Closes file
References WXP::File::close().
|
inline |
Clears tag used in conditional processing of resources
int ResrcFile::close | ( | ) |
int ResrcFile::compare | ( | const char * | resrc, |
const char * | string | ||
) |
Compares resource name against global definitions
resrc | Resource name |
string | String from the file to compare against |
Referenced by WXP::ResrcDB::create().
Gets a resource from the file.
resrc | Output resource name |
value | Output resource value |
References WXP::String::clear(), WXP::StrLib::copy(), WXP::String::copy(), WXP::String::get(), WXP::String::getChar(), WXP::File::getLine(), WXP::StrLib::iequal(), WXP::String::iequal(), WXP::String::lowCase(), WXP::Wxp::outWarning(), WXP::String::scanf(), and WXP::String::trunc().
Referenced by WXP::ResrcDB::create(), and getValid().
Gets only valid resources from the file.
resrc | Output resource name |
value | Output resource value |
References WXP::StrLib::copy(), WXP::String::get(), get(), parseName(), and valid().
Referenced by readFile(), and WXP::Prog::readResrcFile().
int ResrcFile::init | ( | ) |
Initializes class values.
Referenced by ResrcFile(), ResrcFile(), and set().
bool ResrcFile::isOpen | ( | ) |
int ResrcFile::open | ( | const char * | fname | ) |
Opens the resrouce file and inserts values into the resource database
fname | File to open |
References WXP::FileTool::addPathDelim(), WXP::String::append(), WXP::String::copy(), WXP::FileTool::exist(), WXP::String::get(), WXP::FileTool::isDir(), WXP::File::isOpen(), WXP::File::open(), and WXP::StrLib::valid().
Referenced by WXP::ResrcDB::create(), readFile(), WXP::Prog::readResrcFile(), and ResrcFile().
|
static |
Parses the resource name from the absolute resource in file
str | Raw resource name from file |
resrc | Output resource name |
References WXP::String::set().
Referenced by WXP::ResrcDB::create(), and getValid().
int ResrcFile::readFile | ( | Resrc & | resrc, |
const char * | filename | ||
) |
Reads in a file and sets all the valid resources.
resrc | Resource object to put data |
filename | File to read resources from |
References WXP::String::get(), getValid(), open(), and WXP::Resrc::set().
int ResrcFile::set | ( | const char * | rprog, |
const char * | rname | ||
) |
Sets the program and resource name values
rprog | Program name |
rname | Resource name |
References WXP::StrLib::copy().
int ResrcFile::set | ( | Resrc & | resrc | ) |
Sets prog and name values from provided resource database
resrc | Resource database to use to set values |
References WXP::StrLib::copy(), WXP::Resrc::get(), and init().
Referenced by WXP::Prog::readResrcFile(), ResrcFile(), and ResrcFile().
int ResrcFile::setTag | ( | const char * | str | ) |
Sets the tag values. Used for conditional processing of resource file
str | Tag name |
References WXP::StrLib::copy().
Referenced by WXP::ResrcDB::create(), and WXP::Prog::readResrcFile().
int ResrcFile::valid | ( | const char * | string | ) |
Determines if resource is valid for this program
string | String from the file to compare against |
References WXP::StrLib::copy().
Referenced by WXP::ResrcDB::create(), and getValid().