X-Git-Url: https://git.llucax.com/z.facultad/75.42/string.git/blobdiff_plain/f3e36100ec2a1f73877100992cddfdc8dc13312b..6433cf237a213c6ba195e534da110733de9b4716:/unicode.cpp diff --git a/unicode.cpp b/unicode.cpp index 127754b..398f82c 100644 --- a/unicode.cpp +++ b/unicode.cpp @@ -37,12 +37,12 @@ Unicode::~Unicode(void) { std::cerr << "En destructor de Unicode." << std::endl; #endif } -#include -bool Unicode::is_endl(void) { + +bool Unicode::is_endl(void) const { #ifdef DEBUG std::cerr << "En Unicode::is_endl()." << std::endl; #endif - // Si los Ășltimos 8 bits son 0xA = 10 = '\n' devuelve true. + // Si los primeros o Ășltimos 8 bits son 0xA = 10 = '\n' devuelve true. return (static_cast(caracter) == '\n') || (static_cast(caracter >> 8) == '\n'); } @@ -55,14 +55,22 @@ Unicode& Unicode::operator=(const Unicode& unicode) { return *this; } -bool Unicode::operator<(const Unicode& unicode) { +Unicode& Unicode::operator=(short c) { +#ifdef DEBUG + std::cerr << "En operator= de Unicode (short)." << std::endl; +#endif + caracter = c; + return *this; +} + +bool Unicode::operator<(const Unicode& unicode) const { #ifdef DEBUG std::cerr << "En operator< de Unicode." << std::endl; #endif return caracter < unicode.caracter; } -bool Unicode::operator==(const Unicode& unicode) { +bool Unicode::operator==(const Unicode& unicode) const { #ifdef DEBUG std::cerr << "En operator== de Unicode." << std::endl; #endif