PhoenixFileParser  1.0.0
Set of tools to ease file parsing
Loading...
Searching...
No Matches
PLocation Class Reference

Classe qui permet de décrire une localisation, avec un nom de fichier et une ligne. More...

#include <PLocation.h>

Public Member Functions

size_t getColumn () const
 renvoie la colonne du PLocation
 
PPath getFileName () const
 renvoie le fichier du PLocation
 
size_t getLine () const
 renvoie la ligne du PLocation
 
PLocationoperator= (const PLocation &other)
 Définition de l'opérateur = de PLocation.
 
 PLocation (const PLocation &other)
 Constructeur de copier de PLocation.
 
 PLocation (const PPath &fileName=PPath(), size_t line=0lu, size_t column=0lu)
 Constructeur par défaut de PLocation.
 
void setColumn (size_t column)
 fonction qui permet d'initialiser la colonne du PLocation
 
void setFileName (const PPath &fileName)
 fonction qui permet d'initialiser la ligne du PLocation
 
void setLine (size_t line)
 fonction qui permet d'initialiser la ligne du PLocation
 
virtual ~PLocation ()
 Destructeur de PLocation.
 

Private Member Functions

void copyPLocation (const PLocation &other)
 Fonction de copie de la classe PLocation.
 
void initialisationPLocation (const PPath &fileName, size_t line, size_t column)
 Fonction d'initialisation de la classe PLocation.
 

Private Attributes

size_t p_column
 COlonne du fichier vers laquelle le PLocation pointe.
 
PPath p_fileName
 fichier vers lequel le PLocation pointe
 
size_t p_line
 ligne du fichier vers lequel le PLocation pointe
 

Friends

bool operator!= (const PLocation &other1, const PLocation &other2)
 Définition de l'opérateur ami != de la classe PLocation.
 
std::ostream & operator<< (std::ostream &out, const PLocation &other)
 Définition de l'opérateur ami << de la classe PLocation.
 
bool operator== (const PLocation &other1, const PLocation &other2)
 Définition de l'opérateur ami == de la classe PLocation.
 

Detailed Description

Classe qui permet de décrire une localisation, avec un nom de fichier et une ligne.

Definition at line 15 of file PLocation.h.

Constructor & Destructor Documentation

◆ PLocation() [1/2]

PLocation::PLocation ( const PPath & fileName = PPath(),
size_t line = 0lu,
size_t column = 0lu )

Constructeur par défaut de PLocation.

Parameters
fileName: fichier vers lequel le PLocation pointe
line: ligne du fichier vers lequel le PLocation pointe
column: colonne du fichier vers lequel le PLocation pointe

Definition at line 22 of file PLocation.cpp.

22 {
23 initialisationPLocation(fileName, line, column);
24}
void initialisationPLocation(const PPath &fileName, size_t line, size_t column)
Fonction d'initialisation de la classe PLocation.

References initialisationPLocation().

Referenced by copyPLocation(), operator!=, operator<<, operator=(), operator==, and PLocation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PLocation() [2/2]

PLocation::PLocation ( const PLocation & other)

Constructeur de copier de PLocation.

Parameters
other: PLocation à copier

Definition at line 29 of file PLocation.cpp.

29 {
30 copyPLocation(other);
31}
void copyPLocation(const PLocation &other)
Fonction de copie de la classe PLocation.

References copyPLocation(), and PLocation().

+ Here is the call graph for this function:

◆ ~PLocation()

PLocation::~PLocation ( )
virtual

Destructeur de PLocation.

Definition at line 34 of file PLocation.cpp.

34 {
35
36}

Member Function Documentation

◆ copyPLocation()

void PLocation::copyPLocation ( const PLocation & other)
private

Fonction de copie de la classe PLocation.

Parameters
other: PLocation à copier

Definition at line 150 of file PLocation.cpp.

150 {
151 p_fileName = other.p_fileName;
152 p_line = other.p_line;
153 p_column = other.p_column;
154}
size_t p_column
COlonne du fichier vers laquelle le PLocation pointe.
Definition PLocation.h:44
PPath p_fileName
fichier vers lequel le PLocation pointe
Definition PLocation.h:40
size_t p_line
ligne du fichier vers lequel le PLocation pointe
Definition PLocation.h:42

References p_column, p_fileName, p_line, and PLocation().

Referenced by operator=(), and PLocation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumn()

size_t PLocation::getColumn ( ) const

renvoie la colonne du PLocation

Returns
colonne du PLocation

Definition at line 74 of file PLocation.cpp.

74 {
75 return p_column;
76}

References p_column.

Referenced by PFileParser::setLocation().

+ Here is the caller graph for this function:

◆ getFileName()

PPath PLocation::getFileName ( ) const

renvoie le fichier du PLocation

Returns
fichier du PLocation

Definition at line 60 of file PLocation.cpp.

60 {
61 return p_fileName;
62}

References p_fileName.

Referenced by PFileParser::setLocation().

+ Here is the caller graph for this function:

◆ getLine()

size_t PLocation::getLine ( ) const

renvoie la ligne du PLocation

Returns
ligne du PLocation

Definition at line 67 of file PLocation.cpp.

67 {
68 return p_line;
69}

References p_line.

Referenced by PFileParser::setLocation().

+ Here is the caller graph for this function:

◆ initialisationPLocation()

void PLocation::initialisationPLocation ( const PPath & fileName,
size_t line,
size_t column )
private

Fonction d'initialisation de la classe PLocation.

Parameters
fileName: fichier vers lequel le PLocation pointe
line: ligne du fichier vers lequel le PLocation pointe
column: colonne du fichier vers lequel le PLocation pointe

Definition at line 141 of file PLocation.cpp.

141 {
142 p_fileName = fileName;
143 p_line = line;
144 p_column = column;
145}

References p_column, p_fileName, and p_line.

Referenced by PLocation().

+ Here is the caller graph for this function:

◆ operator=()

PLocation & PLocation::operator= ( const PLocation & other)

Définition de l'opérateur = de PLocation.

Parameters
other: PLocation à copier
Returns
PLocation copiée

Definition at line 89 of file PLocation.cpp.

89 {
90 copyPLocation(other);
91 return *this;
92}

References copyPLocation(), and PLocation().

+ Here is the call graph for this function:

◆ setColumn()

void PLocation::setColumn ( size_t column)

fonction qui permet d'initialiser la colonne du PLocation

Parameters
column: colonne du PLocation

Definition at line 55 of file PLocation.cpp.

55{p_column = column;}

References p_column.

◆ setFileName()

void PLocation::setFileName ( const PPath & fileName)

fonction qui permet d'initialiser la ligne du PLocation

Parameters
fileName: fichier du PLocation

Definition at line 41 of file PLocation.cpp.

41 {
42 p_fileName = fileName;
43}

References p_fileName.

◆ setLine()

void PLocation::setLine ( size_t line)

fonction qui permet d'initialiser la ligne du PLocation

Parameters
line: ligne du PLocation

Definition at line 48 of file PLocation.cpp.

48 {
49 p_line = line;
50}

References p_line.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const PLocation & other1,
const PLocation & other2 )
friend

Définition de l'opérateur ami != de la classe PLocation.

Parameters
other1: PLocation
other2: PLocation
Returns
false si other1 et other2 sont égaux, true sinon

Definition at line 115 of file PLocation.cpp.

115 {
116 return (other1.p_fileName != other2.p_fileName || other1.p_line != other2.p_line);
117}

References p_fileName, p_line, and PLocation().

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const PLocation & other )
friend

Définition de l'opérateur ami << de la classe PLocation.

Parameters
out: sortie standart de la console (cout)
other: PLocation à affiche dans la console
Returns
sortie standart de la console (cout)

Definition at line 124 of file PLocation.cpp.

124 {
125 out << "'" << other.p_fileName << "':" << other.p_line << ":" << other.p_column;
126 return out;
127}

References p_column, p_fileName, p_line, and PLocation().

◆ operator==

bool operator== ( const PLocation & other1,
const PLocation & other2 )
friend

Définition de l'opérateur ami == de la classe PLocation.

Parameters
other1: PLocation
other2: PLocation
Returns
true si other1 et other2 sont égaux, false sinonPLocation

Definition at line 106 of file PLocation.cpp.

106 {
107 return (other1.p_fileName == other2.p_fileName && other1.p_line == other2.p_line);
108}

References p_fileName, p_line, and PLocation().

Member Data Documentation

◆ p_column

size_t PLocation::p_column
private

COlonne du fichier vers laquelle le PLocation pointe.

Definition at line 44 of file PLocation.h.

Referenced by copyPLocation(), getColumn(), initialisationPLocation(), operator<<, and setColumn().

◆ p_fileName

PPath PLocation::p_fileName
private

fichier vers lequel le PLocation pointe

Definition at line 40 of file PLocation.h.

Referenced by copyPLocation(), getFileName(), initialisationPLocation(), operator!=, operator<<, operator==, and setFileName().

◆ p_line

size_t PLocation::p_line
private

ligne du fichier vers lequel le PLocation pointe

Definition at line 42 of file PLocation.h.

Referenced by copyPLocation(), getLine(), initialisationPLocation(), operator!=, operator<<, operator==, and setLine().


The documentation for this class was generated from the following files: