PhoenixFileParser
1.7.3
Set of tools to ease file parsing
Toggle main menu visibility
Loading...
Searching...
No Matches
PLocation.cpp
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
#include "
PLocation.h
"
8
9
11
// //
12
// Fonctions publiques de la classe PLocation //
13
// //
15
16
18
22
PLocation::PLocation
(
const
PPath & fileName,
size_t
line,
size_t
column){
23
initialisationPLocation
(fileName, line, column);
24
}
25
27
29
PLocation::PLocation
(
const
PLocation
& other){
30
copyPLocation
(other);
31
}
32
34
PLocation::~PLocation
(){
35
36
}
37
39
41
void
PLocation::setFileName
(
const
PPath & fileName){
42
p_fileName
= fileName;
43
}
44
46
48
void
PLocation::setLine
(
size_t
line){
49
p_line
= line;
50
}
51
53
55
void
PLocation::setColumn
(
size_t
column){
p_column
= column;}
56
58
60
const
PPath &
PLocation::getFileName
()
const
{
61
return
p_fileName
;
62
}
63
65
67
size_t
PLocation::getLine
()
const
{
68
return
p_line
;
69
}
70
72
74
size_t
PLocation::getColumn
()
const
{
75
return
p_column
;
76
}
77
79
// //
80
// Les opérateurs de la classe PLocation //
81
// //
83
84
86
89
PLocation
&
PLocation::operator =
(
const
PLocation
& other){
90
copyPLocation
(other);
91
return
*
this
;
92
}
93
95
// //
96
// Les opérateurs amis de la classe PLocation //
97
// //
99
100
102
106
bool
operator ==
(
const
PLocation
& other1,
const
PLocation
& other2){
107
return
(other1.
p_fileName
== other2.
p_fileName
&& other1.
p_line
== other2.
p_line
&& other1.
p_column
== other2.
p_column
);
108
}
109
111
115
bool
operator !=
(
const
PLocation
& other1,
const
PLocation
& other2){
116
return
(other1.
p_fileName
!= other2.
p_fileName
|| other1.
p_line
!= other2.
p_line
|| other1.
p_column
!= other2.
p_column
);
117
}
118
120
124
std::ostream &
operator <<
(std::ostream & out,
const
PLocation
& other){
125
out <<
"'"
<< other.
p_fileName
<<
"':"
<< other.
p_line
<<
":"
<< other.
p_column
;
126
return
out;
127
}
128
130
// //
131
// Fonctions private de la classe PLocation //
132
// //
134
135
137
141
void
PLocation::initialisationPLocation
(
const
PPath & fileName,
size_t
line,
size_t
column){
142
p_fileName
= fileName;
143
p_line
= line;
144
p_column
= column;
145
}
146
148
150
void
PLocation::copyPLocation
(
const
PLocation
& other){
151
p_fileName
= other.
p_fileName
;
152
p_line
= other.
p_line
;
153
p_column
= other.
p_column
;
154
}
155
operator==
bool operator==(const PLocation &other1, const PLocation &other2)
Définition de l'opérateur ami == de la classe PLocation.
Definition
PLocation.cpp:106
operator!=
bool operator!=(const PLocation &other1, const PLocation &other2)
Définition de l'opérateur ami != de la classe PLocation.
Definition
PLocation.cpp:115
operator<<
std::ostream & operator<<(std::ostream &out, const PLocation &other)
Définition de l'opérateur ami << de la classe PLocation.
Definition
PLocation.cpp:124
PLocation.h
PLocation::p_column
size_t p_column
COlonne du fichier vers laquelle le PLocation pointe.
Definition
PLocation.h:44
PLocation::PLocation
PLocation(const PPath &fileName=PPath(), size_t line=0lu, size_t column=0lu)
Constructeur par défaut de PLocation.
Definition
PLocation.cpp:22
PLocation::p_fileName
PPath p_fileName
fichier vers lequel le PLocation pointe
Definition
PLocation.h:40
PLocation::setFileName
void setFileName(const PPath &fileName)
fonction qui permet d'initialiser la ligne du PLocation
Definition
PLocation.cpp:41
PLocation::getLine
size_t getLine() const
renvoie la ligne du PLocation
Definition
PLocation.cpp:67
PLocation::initialisationPLocation
void initialisationPLocation(const PPath &fileName, size_t line, size_t column)
Fonction d'initialisation de la classe PLocation.
Definition
PLocation.cpp:141
PLocation::getFileName
const PPath & getFileName() const
renvoie le fichier du PLocation
Definition
PLocation.cpp:60
PLocation::setLine
void setLine(size_t line)
fonction qui permet d'initialiser la ligne du PLocation
Definition
PLocation.cpp:48
PLocation::operator=
PLocation & operator=(const PLocation &other)
Définition de l'opérateur = de PLocation.
Definition
PLocation.cpp:89
PLocation::~PLocation
virtual ~PLocation()
Destructeur de PLocation.
Definition
PLocation.cpp:34
PLocation::getColumn
size_t getColumn() const
renvoie la colonne du PLocation
Definition
PLocation.cpp:74
PLocation::copyPLocation
void copyPLocation(const PLocation &other)
Fonction de copie de la classe PLocation.
Definition
PLocation.cpp:150
PLocation::p_line
size_t p_line
ligne du fichier vers lequel le PLocation pointe
Definition
PLocation.h:42
PLocation::setColumn
void setColumn(size_t column)
fonction qui permet d'initialiser la colonne du PLocation
Definition
PLocation.cpp:55
src
PLocation.cpp
Generated by
1.17.0