std::cerr << "En destructor de Unicode." << std::endl;
#endif
}
-#include <iostream>
-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<char>(caracter) == '\n')
|| (static_cast<char>(caracter >> 8) == '\n');
}
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