19Implemente_instanciable_sans_constructeur(
Motcle,
"Motcle",
Nom);
41 return VECT(Motcle)::printOn(s);
131 return VECT(
Motcle)::readOn(s);
144 Motcle un_motcle(
"PasOk");
167static inline int strcmp_uppercase(
const char *n1,
const char *n2)
175 c1 = (
unsigned char) ::toupper(n1[i]);
178 if (c1==0 || c1==124)
185 c2 = (
unsigned char) ::toupper(n2[j]);
188 if (c2==0 || c2==124)
190 if (length_i==length_j)
198 C1 = (
unsigned char) ::toupper(n1[i-l]);
199 C2 = (
unsigned char) ::toupper(n2[j-l]);
203 while (l>1 && delta==0);
226 const int resu = strcmp_uppercase((
const char *) nom, (
const char *)un_mot);
230int operator ==(
const Motcle& un_mot,
const char*
const nom)
232 const int resu = strcmp_uppercase((
const char *)un_mot, nom);
236int operator ==(
const char*
const nom,
const Motcle& un_mot)
238 return (un_mot == nom);
243 const int resu = strcmp_uppercase((
const char *)un_mot, (
const char *) nom);
249 return (un_mot == nom);
260 return ! (nom == un_mot);
263int operator !=(
const Motcle& un_mot,
const char*
const nom)
265 return ! (un_mot == nom);
268int operator !=(
const char*
const nom,
const Motcle& un_mot)
270 return ! (nom == un_mot);
275 return ! (un_mot == nom);
280 return ! (nom == un_mot);
295 for (
int i = 0; i < n; i++)
324 if (
operator[](i)==t)
333 return (
rang(ch)!=-1);
342 if (
operator[](i)==nom)
Class defining operators and methods for all reading operation in an input flow (file,...
A character string (Nom) in uppercase.
int selftest()
Self-test of the Motcle class. Performs control assignments.
int finit_par(const char *const n) const override
Motcle()
Default constructor. Constructs a Nom and converts it to uppercase.
Motcle & operator+=(const char *const)
Motcle & operator=(const Motcle &)
Copy assignment operator. Uses the implementation of the Nom class.
int debute_par(const char *const n) const override
int find(const char *const n) const override
An array of Motcle objects.
int rang(const char *const ch) const
int contient_(const char *const ch) const
Motcles(int)
Constructor. Creates an array of i elements.
int search(const Motcle &t) const
class Nom: a character string for naming TRUST objects.
Nom()
Default constructor. Creates the string "??".
virtual int finit_par(const char *const n) const
Nom & operator=(const char *const)
Copies the string nom.
virtual int debute_par(const char *const n) const
virtual int find(const char *const n) const
Nom & operator+=(const Nom &x)
Concatenation with a Nom.
Nom & majuscule()
Converts the name to uppercase. Only letters 'a'-'z' are modified.
An array of character strings (VECT(Nom)).
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Base class for output streams.