Document Reference. More...
#include <gdocref.h>
Public Member Functions | |
GDocRef (GDoc *doc) | |
int | Compare (const GDocRef &ref) const |
int | Compare (const GDoc *doc) const |
GDoc * | GetDoc (void) const |
void | Clear (void) |
GDocFragment * | AddFragment (const GConceptRecord *rec, size_t pos, size_t spos, size_t begin, size_t end, bool &exist) |
GDocFragment * | AddFragment (const GConceptRecord *rec) |
GDocFragment * | AddFragment (const GConceptRecord *rec, const GConceptRecord *child, size_t pos, size_t spos, size_t begin, size_t end, bool &exist) |
GDocFragment * | AddFragment (const GConceptRecord *rec, const GConceptRecord *child, bool &exist) |
GDocFragment * | AddFragment (GDoc *doc, const GConceptRecord *child, size_t begin, size_t end, bool &exist) |
GDocFragment * | CopyFragment (const GDocFragment *tocopy, bool &exist) |
void | CopyFragments (const GDocRef *tocopy) |
size_t | GetNbFragments (void) const |
R::RCursor< GDocFragment > | GetFragments (void) const |
bool | FindSibling (GDocFragment *fragment) const |
bool | FindChild (GDocFragment *fragment) const |
void | Reduce (bool force) |
void | Print (void) |
Private Attributes | |
GDoc * | Doc |
R::RContainer< GDocFragment, true, true > | Fragments |
Detailed Description
Document Reference.
The GDocRef class provides a reference of a document and a set of fragments.
Constructor & Destructor Documentation
Member Function Documentation
int Compare | ( | const GDocRef & | ref | ) | const |
Compare two document references.
- Parameters
-
ref Document reference to compare with.
- Returns
- -1,0 or 1 depending on the comparison of the document identifiers.
int Compare | ( | const GDoc * | doc | ) | const |
Compare a document reference and a document.
- Parameters
-
doc Document to compare with.
- Returns
- -1,0 or 1 depending on the comparison of the document identifiers.
void Clear | ( | void | ) |
Clear the fragments.
GDocFragment* AddFragment | ( | const GConceptRecord * | rec, |
size_t | pos, | ||
size_t | spos, | ||
size_t | begin, | ||
size_t | end, | ||
bool & | exist | ||
) |
Add a fragment related to a given node.
- Parameters
-
node Concept node associated to the fragment. pos Position of the concept node that identifies the fragment. spos Syntactic position of the fragment centre. begin Beginning of the fragment. end Ending of the fragment. exist Set by the method to specify if the fragment already exists (true) or was created (false).
- Returns
- a pointer to a GDocFragment.
GDocFragment* AddFragment | ( | const GConceptRecord * | rec | ) |
Add a fragment related to a given record. The fragment is limited to the concept node.
- Parameters
-
node Concept node associated to the fragment.
- Returns
- a pointer to a GDocFragment.
GDocFragment* AddFragment | ( | const GConceptRecord * | rec, |
const GConceptRecord * | child, | ||
size_t | pos, | ||
size_t | spos, | ||
size_t | begin, | ||
size_t | end, | ||
bool & | exist | ||
) |
Add a fragment selected by a child node.
- Parameters
-
node Concept node associated to the fragment. child Child concept node use to select the concept node. pos Position of the concept node that identifies the fragment. spos Syntactic position of the fragment centre. begin Beginning of the fragment. end Ending of the fragment. exist Set by the method to specify if the fragment already exists (true) or was created (false).
- Returns
- a pointer to a GDocFragment.
GDocFragment* AddFragment | ( | const GConceptRecord * | rec, |
const GConceptRecord * | child, | ||
bool & | exist | ||
) |
Add a fragment selected by a child node. The fragment is limited to the concept node and the child node.
- Parameters
-
node Concept node associated to the fragment. child Child concept node use to select the concept node. exist Set by the method to specify if the fragment already exists (true) or was created (false).
- Returns
- a pointer to a GDocFragment.
GDocFragment* AddFragment | ( | GDoc * | doc, |
const GConceptRecord * | child, | ||
size_t | begin, | ||
size_t | end, | ||
bool & | exist | ||
) |
Add a document that represents the whole document.
- Parameters
-
doc Document. child Child concept node use to select the concept node. begin Beginning of the fragment. end Ending of the fragment. exist Set by the method to specify if the fragment already exists (true) or was created (false).
- Returns
- a pointer to a GDocFragment.
GDocFragment* CopyFragment | ( | const GDocFragment * | tocopy, |
bool & | exist | ||
) |
Copy a fragment into the container.
- Parameters
-
tocopy Fragment to copy. exist Set by the method to specify if the fragment already exists (true) or was created (false).
- Returns
- a pointer to a GDocFragment.
void CopyFragments | ( | const GDocRef * | tocopy | ) |
Copy a set of fragments into the container.
- Parameters
-
tocopy Fragments to copy.
- Returns
size_t GetNbFragments | ( | void | ) | const |
- Returns
- the number of fragment.
R::RCursor<GDocFragment> GetFragments | ( | void | ) | const |
Get all the fragments.
- Returns
- a R::RCursor of GDocFragment.
bool FindSibling | ( | GDocFragment * | fragment | ) | const |
Look if a document fragment has a sibling fragment in the container.
- Parameters
-
fragment Fragment to analyse.
- Returns
- true if it is the case.
bool FindChild | ( | GDocFragment * | fragment | ) | const |
Look if a document fragment has a child fragment in the container.
- Parameters
-
fragment Fragment to analyse.
- Returns
- true if it is the case.
void Reduce | ( | bool | force | ) |
Reduce the fragments.
- Parameters
-
force Force to merge the fragments sharing the same node. It should be true in the case of an AND operator, and false in the case of an OR operator.
void Print | ( | void | ) |
Print the information of each fragment.
Member Data Documentation
|
private |
Document referenced.
|
private |
List of fragments.