WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
WXP::ResrcFile Class Reference

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)
 

Detailed Description

This class reads resource values in from a file.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ ResrcFile() [1/3]

ResrcFile::ResrcFile ( )

Constructor. Initializes class values

References init().

◆ ResrcFile() [2/3]

ResrcFile::ResrcFile ( Resrc resrc)

Constructor. Sets prog and name values from provided resource database

Parameters
resrcResource database to use to set values

References init(), and set().

◆ ResrcFile() [3/3]

ResrcFile::ResrcFile ( Resrc resrc,
const char *  file 
)

Constructor. Sets prog and name values from resource database and opens file

Parameters
resrcResource database to use to set prog and name
fileResource file to open

References open(), and set().

◆ ~ResrcFile()

ResrcFile::~ResrcFile ( )

Destructor. Closes file

References WXP::File::close().

Member Function Documentation

◆ clearTag()

int WXP::ResrcFile::clearTag ( )
inline

Clears tag used in conditional processing of resources

◆ close()

int ResrcFile::close ( )

Closes the file

References WXP::File::close().

Referenced by WXP::ResrcDB::create().

◆ compare()

int ResrcFile::compare ( const char *  resrc,
const char *  string 
)

Compares resource name against global definitions

Parameters
resrcResource name
stringString from the file to compare against

Referenced by WXP::ResrcDB::create().

◆ get()

int ResrcFile::get ( String resrc,
String value 
)

◆ getValid()

int ResrcFile::getValid ( String resrc,
String value 
)

Gets only valid resources from the file.

Return values
resrcOutput resource name
valueOutput resource value

References WXP::StrLib::copy(), WXP::String::get(), get(), parseName(), and valid().

Referenced by readFile(), and WXP::Prog::readResrcFile().

◆ init()

int ResrcFile::init ( )

Initializes class values.

Referenced by ResrcFile(), ResrcFile(), and set().

◆ isOpen()

bool ResrcFile::isOpen ( )

Is resource file open

Returns
True if file open

Referenced by WXP::ResrcDB::create().

◆ open()

int ResrcFile::open ( const char *  fname)

◆ parseName()

int ResrcFile::parseName ( const char *  str,
String resrc 
)
static

Parses the resource name from the absolute resource in file

Parameters
strRaw resource name from file
Return values
resrcOutput resource name

References WXP::String::set().

Referenced by WXP::ResrcDB::create(), and getValid().

◆ readFile()

int ResrcFile::readFile ( Resrc resrc,
const char *  filename 
)

Reads in a file and sets all the valid resources.

Return values
resrcResource object to put data
Parameters
filenameFile to read resources from

References WXP::String::get(), getValid(), open(), and WXP::Resrc::set().

◆ set() [1/2]

int ResrcFile::set ( const char *  rprog,
const char *  rname 
)

Sets the program and resource name values

Parameters
rprogProgram name
rnameResource name

References WXP::StrLib::copy().

◆ set() [2/2]

int ResrcFile::set ( Resrc resrc)

Sets prog and name values from provided resource database

Parameters
resrcResource database to use to set values

References WXP::StrLib::copy(), WXP::Resrc::get(), and init().

Referenced by WXP::Prog::readResrcFile(), ResrcFile(), and ResrcFile().

◆ setTag()

int ResrcFile::setTag ( const char *  str)

Sets the tag values. Used for conditional processing of resource file

Parameters
strTag name

References WXP::StrLib::copy().

Referenced by WXP::ResrcDB::create(), and WXP::Prog::readResrcFile().

◆ valid()

int ResrcFile::valid ( const char *  string)

Determines if resource is valid for this program

Parameters
stringString from the file to compare against

References WXP::StrLib::copy().

Referenced by WXP::ResrcDB::create(), and getValid().


The documentation for this class was generated from the following files: