User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Text Processing - TextFileC
 

  PUBLIC
TextFileC::TextFileC(void)
TextFileC::TextFileC(bool)
TextFileC::TextFileC(TextBufferC &)
TextFileC::TextFileC(const StringC &)
TextFileC::TextFileC(const StringC &,bool,bool)
TextFileC::TextFileC(istream &)
TextFileC::Load(const StringC &)
TextFileC::Load(istream &)
TextFileC::Save(void)
TextFileC::SetFilename(const StringC &)
TextFileC::Filename(void) const
TextFileC::Filename(void)
TextFileC::operator +=(const StringC &)
TextFileC::SetRenumber(void)
TextFileC::Empty(void)
TextFileC::Dump(ostream &) const
TextFileC::IsLoaded(void) const
TextFileC::FindLineMatch(const StringC &)
TextBufferC::Load(const StringC &)
TextBufferC::Load(istream &)
TextBufferC::AppendFile(const StringC &)
TextBufferC::Append(istream &)
TextBufferC::SaveAs(const StringC &)
TextBufferC::AppendLine(const StringC &,bool)
TextBufferC::Append(const StringC &,bool)
TextBufferC::GlobalSubst(const StringC &,const StringC &)
TextBufferC::Empty(void)
TextBufferC::Dump(ostream &) const
TextBufferC::NoLines(void) const
TextBufferC::IsReadonly(void) const
TextBufferC::SetModified(void)
TextBufferC::Lines(void)
TextBufferC::operator [](IntT)
TextBufferC::IsModified(void) const
TextBufferC::SetReadonly(bool)
TextBufferC::RemoveTrailingWhiteSpace(void)
RCHandleC::operator =(const RCHandleC &)
RCHandleC::DeepCopy(UIntT) const
RCHandleC::operator ==(const RCHandleC &) const
RCHandleC::operator !=(const RCHandleC &) const
RCHandleC::Hash(void) const
RCHandleC::IsValid(void) const
RCHandleC::Invalidate(void)
RCHandleC::IsHandleType(const DT &) const
RCHandleC::CheckHandleType(const DT &) const
RCHandleC::References(void) const
RCHandleC::operator <<(ostream &,const RCHandleC &)
RCHandleC::operator >>(istream &,RCHandleC &)

   TextFileC   
 
Text File, for use in text processing.
 
include "Ravl/Text/TextFile.hh"
Created:05/12/1997 
User Level:Normal
Library:RavlOS
In Scope:RavlN

Comments:
This is a BIG object!

Parent Classes: Derived Classes: Methods:
TextFileC()
Default constructor.
creates an invalid handle.

TextFileC(bool)
Constructor.
Creates an empty text file.

TextFileC(TextBufferC & tb)
Construct from a text buffer.

TextFileC(const StringC & filename)
Constructor from a file.

TextFileC(const StringC & text,bool noFinalReturn,bool concat = false)
Construct from a string.
If 'noFinalReturn' is false, ensure each line ends with '\n', otherwise leave it alone.

concat, if true don't split lines, otherwise do.


TextFileC(istream & fin)
Constructor from a stream.

bool Load(const StringC & filename)
Try and load a file.
NB. If this is called on an invalid buffer a new buffer will be created.

** MUST BE OVERLOADED IN DERIVED CLASSES **


bool Load(istream & instrm)
Load buffer from a stream.
NB. If this is called on an invalid buffer a new buffer will be created.

** MUST BE OVERLOADED IN DERIVED CLASSES **


bool Save()
Try and save this file.

bool SetFilename(const StringC & filename)
Set filename to use.

const StringC & Filename() const
Get the name of the file.

StringC & Filename()
Get the name of the file.

bool operator +=(const StringC & text)
Append a line of text to the end of the file.

void SetRenumber()
Set renumber flag.

void Empty()
Empty all contents, set name to noname

void Dump(ostream & strm) const
Dump to stdout.

bool IsLoaded() const
Have file loaded into memory ?

IntT FindLineMatch(const StringC & str)
Find a line begining with string 'str'.
returns line no otherwise -1.

#include "Ravl/Text/TextBuffer.hh"
bool Load(const StringC & filename)
Try and load a file.

bool Load(istream & strm)
Create buffer from stream.

bool AppendFile(const StringC & filename)
Append a file to the end of this one.

bool Append(istream & strm)
Append contents of a stream to this file.

bool SaveAs(const StringC & filename)
Try and save this file as another name.

UIntT AppendLine(const StringC & text,bool noFinalRet = false)
Append a line of text to file.
If 'noFinalReturn' is false, ensure each line ends with '\n', otherwise leave it alone.

returns LineNo or -1 if failed.



UIntT Append(const StringC & text,bool noFinalRet = false)
Append a line of text to file.
If 'noFinalReturn' is false, ensure each line ends with '\n', otherwise leave it alone.

returns LineNo or -1 if failed.



IntT GlobalSubst(const StringC & org,const StringC & nv)
Substute 'org' for 'nv' the whole buffer.
returns the number of substitutions done.

void Empty()
Empty all contents, set name to noname

void Dump(ostream & strm) const
Dump to stdout.
For debuging only.

UIntT NoLines() const
Return number of lines in buffer.

bool IsReadonly() const
Is readonly ?

void SetModified()
Set renumber flag.

DListC<TextFileLineC> & Lines()
Access list of lines directly.

StringC & operator [](IntT x)
Access a line in the file.

bool IsModified() const
Has buffer been modified ?

void SetReadonly(bool newval)
Set readonly flag for file.

bool RemoveTrailingWhiteSpace()
Remove trailing white space from the file.
returns true if changes have been made.

#include "Ravl/RefCounter.hh"
const RCHandleC<TextBufferBodyC> & operator =(const RCHandleC<TextBufferBodyC> & oth)
Assign handle.

RCHandleC<TextBufferBodyC> DeepCopy(UIntT levels = ((UIntT))) const
Do a deep copy of the object.

bool operator ==(const RCHandleC<TextBufferBodyC> & oth) const
Are handles to the same object ?

bool operator !=(const RCHandleC<TextBufferBodyC> & oth) const
Are handles to different objects ?

UIntT Hash() const
Default hash function.
This hashes on the address of the body.

bool IsValid() const
Test if this is a valid handle.

void Invalidate()
Invalidate this handle.
Unattaches the body from the handle.

bool IsHandleType(const DT &) const
Is handle of given type ?

void CheckHandleType(const DT & dummy) const
Check handle type. Throw an expception if not.

UIntT References() const
Find the number of references to the body of this object.

ostream & operator <<(ostream & strm,const RCHandleC<TextBufferBodyC> & obj)

istream & operator >>(istream & strm,RCHandleC<TextBufferBodyC> & obj)


Maintainer:Charles Galambos, Created: 05/12/1997, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002