ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Represent/Hexadecimal.hpp
(Generate patch)

Comparing Represent/Hexadecimal.hpp (file contents):
Revision 371 by douglas, 2004-12-21T23:19:54-08:00 vs.
Revision 379 by douglas, 2004-12-22T20:42:52-08:00

# Line 16 | Line 16
16   class Hexadecimal : public Binary
17   {
18   private:
19 <        byte_t hex(const ext::CodePoint atom);
19 >        byte_t hex(const ext::CodePoint& atom);
20   public:
21          Hexadecimal() : Binary() {}
22          Hexadecimal(const Binary& binary) : Binary(binary) {}
# Line 25 | Line 25 | public:
25          virtual operator ext::String() const;
26   };
27  
28 + inline byte_t Hexadecimal::hex(const ext::CodePoint& atom)
29 + {
30 +        if (atom >= '0' && atom <= '9') return atom - '0'; else if (atom >= 'a' && atom <= 'f') return atom - 'a' + 0xA; else if (atom >= 'A' && atom <= 'F') return atom - 'A' + 0xA; else return 0;
31 + }
32 +
33   #endif // _Hexadecimal_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines