---------------------------------------------------------------------
CLASS: CmrWriter --trp
PUBLIC METHODS:
isValid()
Returns TRUE if the object is in a valid state.
beginDir()
Start the scope of a new directory, include name and attr.
endDir()
End the current directory scope.
file()
Define a file.
symlink()
Define a symbolic link.
useShortReservedWords()
Use two letter, rather than default full-sized reserved words.
setTabSize()
Define the tab size for new directories, rahter than default.
USAGE NOTES:
1. A cmrWriter object is constructed with the output file
e.g. cmrWriter cmr("myfile").
The rogue wave RWFile class is used for file io.
2. Options may be set, such as tab size and short token words.
3. Four functions are used to open & close directories, and
specify files and symbolic links. For instance, these calls
cmr.beginDir ("dir1", dir1_attributes);
cmr.file("file1", file1_attributes, file1_extentList);
cmr.symlink ("sym1", sym1_attributes, sym1_pathElementList);
cmr.endDir();
would write CMR like this
begin_dir "dir1"
begin_entries
begin_file "file1" end_file
begin_symlink "sym1" end_symlink
end_entries
end_dir
----------------------------------------------------------------------
---------------------------------------------------------------------
METHOD: CmrWriter::beginDir --trp
Begin directory scope in the CMR file.
Output a new directory entry, flush the line to the output file,
and shift indent right.
ARGS:
char* dirName IN Name of new directory.
Attributes& attr IN Directory attributes.
RETURNS:
PRE-CONDITIONS:
POST-CONDITIONS:
A new directory entry is added to the output, and the indention
is incremented.
ERRORS:
NOTES:
----------------------------------------------------------------------
void
CmrWriter::beginDir (const char *dirName, const Attributes& attr)
---------------------------------------------------------------------
METHOD: CmrWriter::endDir --trp
Close current directory scope.
Decrements indent, and writes dir closing tokens.
ARGS:
RETURNS:
PRE-CONDITIONS:
POST-CONDITIONS:
The indent is decremented.
The directory termination tokens are added to buffer
The buffer is flushed to output file
ERRORS:
NOTES:
----------------------------------------------------------------------
void
CmrWriter::endDir ()
---------------------------------------------------------------------
METHOD: CmrWriter::file --trp
Output a new file entry.
ARGS:
char* fileName IN File name.
Attributes attr IN File attributes.
ExtentList& elist IN File extent list.
RETURNS:
PRE-CONDITIONS:
POST-CONDITIONS:
The file entry begin tokens are added to buffer.
The common attribute info is added to buffer.
The extent list is added to buffer.
The file entry end token is added to buffer.
The buffer is flushed to output file.
ERRORS:
NOTES:
----------------------------------------------------------------------
void
CmrWriter::file (const char *fileName, const Attributes& attr,
const ExtentList& elist)
---------------------------------------------------------------------
METHOD: CmrWriter::symlink --trp
Output a new symbolic link entry.
ARGS:
char* symlinkName IN Symbolic link name.
Attributes attr IN Symbolic link attributes.
PathElementList plist IN Symbolic link path element list.
RETURNS:
PRE-CONDITIONS:
The attribute type is symlink.
POST-CONDITIONS:
The symlink begin tokens are added to the buffer.
The common attributes are added to the buffer.
The path element list is added to the buffer.
The symlink end token added to buffer.
The buffer is flushed.
ERRORS:
An invalid attributes type aborts the program.
NOTES:
----------------------------------------------------------------------
void
CmrWriter::symlink (const char *symlinkName, const Attributes& attr,
const PathElementList& plist)
---------------------------------------------------------------------
METHOD: CmrWriter::useShortReservedWords --trp
Set reserved words option to short.
ARGS:
RETURNS:
PRE-CONDITIONS:
POST-CONDITIONS:
The reserved words option is set to short.
ERRORS:
NOTES:
----------------------------------------------------------------------
void
CmrWriter::useShortReservedWords ()
---------------------------------------------------------------------
METHOD: CmrWriter::setTabSize --trp
Set indention tab size.
ARGS:
int tabSize IN Amount of spaces per indention.
RETURNS:
PRE-CONDITIONS:
POST-CONDITIONS:
Indention tab size is set.
ERRORS:
NOTES:
----------------------------------------------------------------------
void
CmrWriter::setTabSize (const int tabSize)