HTML File. More...

#include <rhtmlfile.h>

Inheritance diagram for RHTMLFile:
[legend]
Collaboration diagram for RHTMLFile:
[legend]

Public Member Functions

 RHTMLFile (void)
 
 RHTMLFile (const RURI &uri, RXMLStruct *xmlstruct, const RCString &encoding="Latin1")
 
 RHTMLFile (RIOFile &file, RXMLStruct *xmlstruct, const RCString &encoding="Latin1")
 
void Open (RIO::ModeType mode)
 
void Open (const RURI &uri, RXMLStruct *xmlstruct, RIO::ModeType mode=RIO::Read, const RCString &encoding="UTF-8")
 
virtual void SetDocType (const RString &docType)
 
virtual void BeginTag (const RString &namespaceURI, const RString &lName, const RString &name)
 
virtual void EndTag (const RString &namespaceURI, const RString &lName, const RString &name)
 
virtual void Text (const RString &text)
 
virtual bool OnlyQuote (void)
 
virtual ~RHTMLFile (void)
 
- Public Member Functions inherited from RXMLFile
 RXMLFile (void)
 
 RXMLFile (const RURI &uri, RXMLStruct *xmlstruct, const RCString &encoding="UTF-8")
 
 RXMLFile (RIOFile &file, RXMLStruct *xmlstruct, const RCString &encoding="UTF-8")
 
bool MustCompressTags (void) const
 
void SetCompressTags (bool compress)
 
void SetEncoding (const RCString &name)
 
void Open (const RURI &uri, RXMLStruct *xmlstruct, RIO::ModeType mode=RIO::Read, const RCString &encoding="UTF-8")
 
virtual void Close (void)
 
virtual ~RXMLFile (void)
 
- Public Member Functions inherited from RXMLParser
 RXMLParser (void)
 
 RXMLParser (const RURI &uri, const RCString &encoding="UTF-8")
 
 RXMLParser (RIOFile &file, const RCString &encoding="UTF-8")
 
void StopAnalysis (void)
 
void SetAvoidSpaces (bool as)
 
size_t GetCurrentDepth (void) const
 
size_t GetLastTokenPos (void) const
 
void SetHTMLMode (bool html)
 
void Open (const RURI &uri, RIO::ModeType mode=RIO::Read, const RCString &encoding="UTF-8")
 
SectionType GetSection (void) const
 
HeaderAttributeType GetHeaderAttribute (void) const
 
bool AcceptHTMLCodes (void)
 
void SetAcceptHTMLCodes (bool accepted)
 
virtual ~RXMLParser (void)
 
void InitParser (void)
 
void SetSection (SectionType section)
 
void ResetDepth (void)
 
bool MustAvoidSpaces (void) const
 
bool HasFoundClosingHTML (void) const
 
RString GetDocType (void) const
 
virtual void HeaderAttribute (const RString &namespaceURI, const RString &lName, const RString &name)
 
virtual void BeginTagParsed (const RString &namespaceURI, const RString &lName, const RString &name)
 
- Public Member Functions inherited from RTextFile
 RTextFile (void)
 
 RTextFile (const RURI &uri, const RCString &encoding="Latin1")
 
 RTextFile (RIOFile &file, const RCString &encoding="Latin1")
 
void Open (const RURI &uri, RIO::ModeType mode=RIO::Read, const RCString &encoding="Latin1")
 
virtual void Seek (off_t pos)
 
virtual void SeekRel (off_t pos)
 
RChar GetNextChar (void) const
 
RChar GetChar (void)
 
const RChar GetCur (void) const
 
RString GetChars (size_t size)
 
RString GetUntilEnd (void)
 
void SkipEol (void)
 
bool CurString (const RString &str, bool CaseSensitive=true, bool skip=true)
 
void SkipComments (void)
 
void SkipSpaces (void)
 
size_t SkipCountSpaces (RChar car)
 
RCString GetEncoding (void) const
 
void SetRemStyle (RemType style)
 
void SetParseSpace (ParseSpaceType parse)
 
ParseSpaceType GetParseSpace (void) const
 
void SetRem (const RString &c)
 
void SetRem (const RString &b, const RString &e)
 
bool MustAddSeparator (void) const
 
void SetAddSeparator (bool add)
 
RString GetWord (void)
 
RString GetToken (const RString &endingchar)
 
RString GetTokenString (const RString &endingstr)
 
RString GetLine (bool skipempty=true)
 
long GetInt (void)
 
unsigned long GetUInt (void)
 
RTextFileoperator>> (RString &str)
 
RTextFileoperator>> (char &nb)
 
RTextFileoperator>> (unsigned char &nb)
 
RTextFileoperator>> (short &nb)
 
RTextFileoperator>> (unsigned short &nb)
 
RTextFileoperator>> (int &nb)
 
RTextFileoperator>> (unsigned int &nb)
 
RTextFileoperator>> (long &nb)
 
RTextFileoperator>> (unsigned long &nb)
 
RTextFileoperator>> (float &nb)
 
RTextFileoperator>> (double &nb)
 
RTextFileoperator>> (long double &nb)
 
void WriteLine (void)
 
void WriteStr (const RString &str, bool invalid=false)
 
void WriteStr (const char *c, bool invalid=false)
 
void WriteStr (const char *c, size_t l, bool invalid=false)
 
RTextFileoperator<< (const char *c)
 
RTextFileoperator<< (const RString &str)
 
void WriteLong (const long nb)
 
RTextFileoperator<< (const char nb)
 
RTextFileoperator<< (const short nb)
 
RTextFileoperator<< (const int nb)
 
RTextFileoperator<< (const long nb)
 
void WriteULong (const unsigned long nb)
 
RTextFileoperator<< (const unsigned char nb)
 
RTextFileoperator<< (const unsigned int nb)
 
RTextFileoperator<< (const unsigned long nb)
 
void WriteBool (const bool b)
 
RTextFileoperator<< (const bool b)
 
void WriteChar (const char c)
 
void WriteFloat (const float nb)
 
RTextFileoperator<< (const float nb)
 
void WriteDouble (const double nb)
 
RTextFileoperator<< (const double nb)
 
void WriteLongDouble (const long double nb)
 
RTextFileoperator<< (const long double nb)
 
void WriteTime (void)
 
void WriteLog (const RString &entry, bool invalid)
 
unsigned long GetLineNb (void) const
 
unsigned long GetLastLine (void) const
 
void SetSeparator (const RString &str)
 
void SetSeparator (const char *str)
 
virtual ~RTextFile (void)
 
- Public Member Functions inherited from RIOFile
 RIOFile (void)
 
 RIOFile (const RURI &uri)
 
 RIOFile (RIOFile &file)
 
RURI GetRealName (void) const
 
void Open (const RURI &uri, RIO::ModeType mode)
 
bool IsOpen (void) const
 
size_t Read (char *buffer, size_t nb, bool move=true)
 
void Write (const char *buffer, size_t nb)
 
virtual void SeekToEnd (void)
 
void Truncate (off_t newsize)
 
bool End (void) const
 
off_t GetSize (void) const
 
off_t GetPos (void) const
 
virtual ~RIOFile (void)
 
- Public Member Functions inherited from RFile
 RFile (void)
 
 RFile (const RURI &uri)
 
 RFile (const RFile &file)
 
void Open (const RURI &uri, RIO::ModeType mode)
 
int Compare (const RFile &file) const
 
int Compare (const RFile *file) const
 
int Compare (const RString &uri) const
 
const RURIGetURI (void) const
 
void SetURI (const RURI &uri)
 
const RString GetFileName (void) const
 
virtual ~RFile (void)
 

Additional Inherited Members

- Public Types inherited from RXMLParser
enum  SectionType { Header, StyleSheet, DOCTYPE, Body }
 
enum  HeaderAttributeType { Encoding, Version, Unknown }
 
- Public Types inherited from RTextFile
enum  RemType { NoComment, SingleLineComment, MultiLineComment, SingleMultiLineComment }
 
enum  ParseSpaceType { LeaveSpaces, SkipAllSpaces }
 
- Static Public Member Functions inherited from RXMLParser
static RChar CodeToChar (const RString &code, bool html)
 
static RString CharToCode (RChar car, bool strict=true)
 
static RString XMLToString (const RString &str, bool html)
 
static RString StringToXML (const RString &str, bool strict=true)
 
- Static Public Member Functions inherited from RTextFile
static bool Eol (RChar car)
 
- Static Public Member Functions inherited from RFile
static RChar GetDirSeparator (void)
 
static void RemoveFile (const RURI &uri)
 
static void RenameFile (const RURI &olduri, const RURI &newuri)
 
static RURI GetTempFile (void)
 
static bool Exists (const RURI &uri)
 
static bool IsDir (const RURI &uri)
 
- Protected Member Functions inherited from RXMLFile
virtual void AddEntity (const RString &name, const RString &value)
 
virtual void HeaderValue (const RString &value)
 
virtual void ResolveNamespace (const RString &namespaceURI)
 
virtual void AddAttribute (const RString &namespaceURI, const RString &lName, const RString &name)
 
virtual void Value (const RString &value)
 
virtual void SetDTD (const RString &dtd)
 
- Protected Member Functions inherited from RXMLParser
RString XMLToString (const RString &str)
 
const HTMLTag * GetCurHTMLTag (void) const
 
const HTMLTag * GetHTMLTag (const RString &name) const
 
bool IsCurTagClosing (void) const
 
- Protected Member Functions inherited from RTextFile
void Next (void)
 
RString GetRealNb (void)
 
void WriteSeparator (void)
 
- Protected Attributes inherited from RXMLFile
RXMLStructXMLStruct
 
bool NewStruct
 
RXMLTagCurTag
 
RXMLAttrCurAttr
 
RString AttrName
 
bool CompressTags
 
- Protected Attributes inherited from RIOFile
bool CanWrite
 
bool CanRead
 
- Protected Attributes inherited from RFile
RIO::ModeType Mode
 
RURI URI
 

Detailed Description

HTML File.

This class represents a HTML file. The file is loaded in a XML structure that should be compatible with XHTML.

Constructor & Destructor Documentation

RHTMLFile ( void  )

Default constructor.

RHTMLFile ( const RURI uri,
RXMLStruct xmlstruct,
const RCString encoding = "Latin1" 
)

Construct a HTML file to read.

Parameters
uriURI of the file.
xmlstructThe XML tree associated with the file.
encodingThe encoding scheme of the file.
RHTMLFile ( RIOFile file,
RXMLStruct xmlstruct,
const RCString encoding = "Latin1" 
)

Construct a HTML file to read.

Parameters
fileA generic input/output file that should be treated as XHML file.
xmlstructThe XML tree associated with the file.
encodingThe encoding scheme of the file.
virtual ~RHTMLFile ( void  )
virtual

Destruct the XML file.

Member Function Documentation

void Open ( RIO::ModeType  mode)
virtual

Open the file

Parameters
modeThe open mode for the file.

Reimplemented from RXMLFile.

void Open ( const RURI uri,
RXMLStruct xmlstruct,
RIO::ModeType  mode = RIO::Read,
const RCString encoding = "UTF-8" 
)

Open the file

Parameters
uriURI of the file.
xmlstructThe XML tree associated with the file
modeThe open mode for the file.
encodingThe encoding scheme of the file.
virtual void SetDocType ( const RString docType)
virtual

Set the doctype of the XML document. The doctype is transform in lowercase and XHTML correspond to the open tag 'html'. If html is not the result, an exception occurs.

Parameters
docTypeName of the encoding.

Reimplemented from RXMLParser.

virtual void BeginTag ( const RString namespaceURI,
const RString lName,
const RString name 
)
virtual

Function called each time a tag will be treated when reading a XML file. Actually, a XMLTag is created and inserted as child of the current tag. At the end, the current tag is set to the new created one.

Parameters
namespaceURIName of the namespace (if any).
lNameLocal name of the tag.
nameComplete name of the tag.
Remarks
The namespace are not treated for the moment, so the namespaceURI and lname parameters are always empty.

Reimplemented from RXMLFile.

virtual void EndTag ( const RString namespaceURI,
const RString lName,
const RString name 
)
virtual

Function called each time a tag was treated when reading a XML file. Actually, the current tag is set its parent.

Parameters
namespaceURIName of the namespace (if any).
lNameLocal name of the tag.
nameComplete name of the tag.
Remarks
The namespace are not treated for the moment, so the namespaceURI and lname parameters are always empty.

Reimplemented from RXMLFile.

virtual void Text ( const RString text)
virtual

Function called each time a text is processed when reading a XML file. Actually, the text is added as content to the current tag.

Parameters
textText processed.

Reimplemented from RXMLFile.

virtual bool OnlyQuote ( void  )
virtual

Function that specify if only quotes are allowed to delimit a parameter in a tag. This function return false since quote can be omitted in HTML.

Reimplemented from RXMLParser.