class HAscii: public TObject



 HAscii

 Base class for ASCII operations, opening and closing files,
 setting active section, reading data and commentaries.



Function Members (Methods)

public:
HAscii()
HAscii(const HAscii& source)
virtual~HAscii()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
Bool_tCheckOpenedFile()
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
voidCloseFile(const Char_t* filename = 0)
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
Bool_tCopySection(const Char_t* sec)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
HAsciiFile*GetActiveFile()
Char_t*GetActiveKeyword()
HAsciiSection*GetActiveSection()
Char_t*GetCommentKeyword()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
Int_tGetNumInLine()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Char_tGetSeparator()
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsNextKeyword()
Bool_tTObject::IsOnHeap() const
Bool_tIsReadFile()
virtual Bool_tTObject::IsSortable() const
Bool_tIsWriteFile()
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
fstream&OpenFile(const Char_t* filename, const Char_t* mode = "read")
voidOpenFileList(const Char_t* filename)
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HAscii&operator=(const HAscii& source)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
Char_t*ReadRemark()
Char_t*ReadString()
Char_t*ReadString(const Char_t* key)
Char_t*ReadString(const Char_t* sec, const Char_t* key)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
HAsciiSection*SetActiveSection(const Char_t* name)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetNumInLine(Int_t num = 16)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetSeparator(Char_t character = ' ')
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
voidWriteError()
Bool_tWriteLine(const Char_t* text, Int_t linelen = 76, Int_t keylen = 0)
Bool_tWriteRemark(const Char_t* text, Char_t sign = ';', Int_t linelen = 76)
Bool_tWriteSection(const Char_t* name)
protected:
HAsciiSection*CheckActiveSection()
Bool_tCheckData()
Bool_tCheckDataPosition(Int_t pos)
Bool_tCheckDataType(Char_t typ)
Char_t*CheckFileList(HAsciiFileList& list, Char_t* name)
Bool_tCheckSection()
Bool_tCheckUnambiguitySection()
voidCloseOpenedFile()
Char_t*ConvertToChar()
Float_t*ConvertToFloat()
Int_t*ConvertToInt()
Char_t*ConvertToString()
Char_t*CorrectName(Char_t* name)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
Char_t*ReadKeywordLine(const Char_t* name = 0)
voidReset()
voidResetBankData()
voidResetKeyData()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
public:
fstreamfStreamFileWrite- stream object handling file writing
protected:
Int_tfDataBank- data bank id specifying type of data
Int_tfDataCounter- number of data units of given type for keyword just read
Int_tfDataLineLength- length of string containing data
HAsciiFileListfFileList- list of files and every file has its list of sections
Char_tfFileWriteName[128]- file name opened in write mode
Int_tfFileWriteState- writing file status, if file opened it is 1, 2 or 3
Char_tfKeyLine[128]- keyword name
Int_tfNumInLine- number of units (digits, characters) in line to be written
Char_tfSeparator- character used as separator (space, tab or comma)
HAsciiFile*fpActiveFile- auxiliary pointer to file containing active section
HAsciiSection*fpActiveSection- auxiliary pointer to active section
Char_t*fpCommentLine- string with commentary line
Char_t*fpDataChar
Float_t*fpDataFloat
Int_t*fpDataInt
Char_t*fpDataLine- string with data as dynamically allocated array
Char_t*fpDataString
Char_t*fpRemarkLine
private:
Long_tfReadAllPosition- position during reading sequentially all data

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HAscii()
 Default constructor. It resets all data and sets pointers to NULL.
~HAscii()
 Destructor releases memory allocated dynamically.
HAscii(const HAscii& source)
HAscii& operator=(const HAscii& source)
Char_t* CorrectName(Char_t* name)
 Function called while opening file error happened to correct file name.
Char_t* CheckFileList(HAsciiFileList& list, Char_t* name)
 It checks if file of given name is not already opened.
void WriteError()
 It checks if the error has happened during write opetarion.
void Reset()
 Resetting data of file (in write mode).
void SetSeparator(Char_t character = ' ')
 Setting separator for data units (only space, tabulation '\t' or comma allowed).
Char_t GetSeparator()
 Getting current separator character for data units.
void CloseOpenedFile()
 Checking if file in write mode is opened (and closing it if yes)
 in case you want to open a new file in write mode.
fstream& OpenFile(const Char_t* filename, const Char_t* mode = "read")
 Opening ASCII file with given 'filename' and 'mode'.

  Modes available:
  "read" or "in"
   - read mode (it is default). Unlimited number of files
     can be opened in read mode.
  "new" or "out" or "create" or "write"
   - write mode. A new file is created but only if there is
     no file with the same 'filename' existing. Only one file
     can be opened in write mode at the same time.
  "update"
   - opens existing file for writing at the end of it (to append data).
  "recreate" or "overwrite"
   - creates a new file or replaces existing in write mode.
void OpenFileList(const Char_t* filename)
 It opens and reads ASCII file with the list of files and opens all of them.
 The file with file list must be in the following syntax:
 section - 'ASCIIFileList'
 keyword - 'Files', followed by string containing all file names (and
 optionally mode), separated by commas.

 Example of file containing list of files to be opened:

  [ASCII File List]
  ; you may put commentaries, as well

  Files = mdcinit.txt, richpads.txt read,
  \ showercal_data.dat,
  \ tofcal.txt read , /scratch/tofini.dat
void CloseFile(const Char_t* filename = 0)
 Closing file of given filename or all opened files if no filename specified.
HAsciiFile* GetActiveFile()
 Pointer to active file (that file which contains active section).
HAsciiSection* GetActiveSection()
 Pointer to active section.
Bool_t CheckUnambiguitySection()
 It checks if a new section name is  unambiguous with relation
 to previously stored while initializing next section list.
HAsciiSection* CheckActiveSection()
 Additional checking and if necessary reinitialization of section list, now not used.
HAsciiSection* SetActiveSection(const Char_t* name)
 Function for section selection. Before reading any data active
 section has to be chosen.
void ResetKeyData()
 It resets variables holding keyword information
 like name, length, data string, commentary string.
void ResetBankData()
 Resetting data bank and bank id.
Bool_t CheckSection()
 Checking if section is selected.
Bool_t CheckData()
 Checking if keyword just read has any data.
Bool_t CheckDataType(Char_t typ)
 It checks whether the call for next data unit of keyword just read
 is of the same type as while keyword reading (this is when
 calling for data without keyword specified but with type
 specified and then it is assumed to read data of last keyword read.
Bool_t CheckDataPosition(Int_t pos)
 Checking if pos is not larger than number of data units;
 in case of string there is always only 1 unit.
Char_t* GetActiveKeyword()
 It returns keyword just read (active keyword).
Char_t* GetCommentKeyword()
 Returning of commentary to the last read keyword if there was any.
Char_t* ReadString()
 Getting string data from data bank if they are present there.
Char_t* ReadString(const Char_t* key)
 Reading data of given keyword key as string.
Char_t* ReadString(const Char_t* sec, const Char_t* key)
 Reading data of given keyword key in section sec as string.
Char_t* ReadRemark()
 It returns commentary to the active section if there is any.
void SetNumInLine(Int_t num = 16)
 Setting number of digits (characters) in one line to which
 writing of ASCII line will be formatted. Default is 16.
Int_t GetNumInLine()
 Number of units (digits, characters) to which written an ASCII line
 will be formatted.
Bool_t CheckOpenedFile()
 Checking if file in write mode is opened.
Bool_t IsReadFile()
 Returns kTRUE if any file in read mode is opened.
Bool_t IsWriteFile()
 Returns kTRUE if a file in write mode is currently opened.
Bool_t WriteLine(const Char_t* text, Int_t linelen = 76, Int_t keylen = 0)
 Writing ASCII line text with given length linelen taking into
 consideration that the first line may follow keyword of given length keylen.
Bool_t WriteRemark(const Char_t* text, Char_t sign = ';', Int_t linelen = 76)
 Writing remark text starting line from sing # or ; (default)
 with a line of length linelen.
Bool_t WriteSection(const Char_t* name)
 Writing section name, brackets [ ] are added automatically.
Bool_t CopySection(const Char_t* sec)
 Copying (writing) section sec if there is any.
Bool_t IsNextKeyword()
 Testing if in given section starting from position fReadAllPosition
 there is any keyword to be read. It is used in case of sequential data
 reading to control the loop and to stop if there are no more keywords
 to be read (i.e. we achieved the end of the section).
Char_t* ReadKeywordLine(const Char_t* name = 0)
 Reading keyword name and keyword data as string from ASCII file.
 If keyword is not specified the sequential reading is done. Reading
 starts then from position fReadAllPosition and every next call of this
 function makes reading of next keyword (with data) until the end of section.
 If you want to read the section sequentially again you nedd to set it
 again as active section (and then fReadAllPosition is resetted).
Int_t* ConvertToInt()
 Conversion of string of data stored in fpDataLine to units of Int_t type.
Float_t* ConvertToFloat()
 Conversion of string of data stored in fpDataLine to units of Float_t type.
Char_t* ConvertToChar()
 Conversion of string of data stored in fpDataLine to units of Char_t type.
 Char_t unit is a single Char_t separated in string by white space or comma.
Char_t* ConvertToString()
 Conversion of string of data stored in fpDataLine to string unit.
 If string begins and ends with quotation marks they are removed.
 String unit is a set of characters terminated by '\0'.

Last change: Sat May 22 12:53:31 2010
Last generated: 2010-05-22 12:53

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.