diff --git a/src/Nibbler.cpp b/src/Nibbler.cpp index cb5d7e43b..132ec15f6 100644 --- a/src/Nibbler.cpp +++ b/src/Nibbler.cpp @@ -403,33 +403,6 @@ bool Nibbler::getInt (int& result) return false; } -//////////////////////////////////////////////////////////////////////////////// -bool Nibbler::getHex (int& result) -{ - std::string::size_type i = _cursor; - - if (i < _length) - { - if (_input[i] == '-') - ++i; - else if (_input[i] == '+') - ++i; - } - - // TODO Potential for use of find_first_not_of - while (i < _length && isxdigit (_input[i])) - ++i; - - if (i > _cursor) - { - result = strtoimax (_input.substr (_cursor, i - _cursor).c_str (), NULL, 16); - _cursor = i; - return true; - } - - return false; -} - //////////////////////////////////////////////////////////////////////////////// bool Nibbler::getUnsignedInt (int& result) { diff --git a/src/Nibbler.h b/src/Nibbler.h index d2eb1d011..b97b12a58 100644 --- a/src/Nibbler.h +++ b/src/Nibbler.h @@ -68,7 +68,6 @@ public: bool getDigit3 (int&); bool getDigit2 (int&); bool getInt (int&); - bool getHex (int&); bool getUnsignedInt (int&); bool getNumber (std::string&); bool getNumber (double&); diff --git a/test/nibbler.t.cpp b/test/nibbler.t.cpp index b2ed19f7a..886153b97 100644 --- a/test/nibbler.t.cpp +++ b/test/nibbler.t.cpp @@ -40,15 +40,15 @@ int main (int argc, char** argv) { #ifdef NIBBLER_FEATURE_DATE #ifdef NIBBLER_FEATURE_REGEX - UnitTest t (417); + UnitTest t (410); #else - UnitTest t (387); + UnitTest t (380); #endif #else #ifdef NIBBLER_FEATURE_REGEX - UnitTest t (353); + UnitTest t (346); #else - UnitTest t (329); + UnitTest t (322); #endif #endif @@ -83,7 +83,6 @@ int main (int argc, char** argv) t.notok (n.getQuoted ('"', s), "trivial: getQuoted"); t.notok (n.getDigit (i), "trivial: getDigit"); t.notok (n.getInt (i), "trivial: getInt"); // 10 - t.notok (n.getHex (i), "trivial: getHex"); t.notok (n.getUnsignedInt (i), "trivial: getUnsignedInt"); t.notok (n.getUntilEOL (s), "trivial: getUntilEOL"); t.notok (n.getUntilEOS (s), "trivial: getUntilEOS"); @@ -301,16 +300,6 @@ int main (int argc, char** argv) t.is (i, -4, " '-4' : getInt () -> '-4'"); t.ok (n.depleted (), " '' : depleted () -> true"); - // bool getHex (int&); - t.diag ("Nibbler::getHex"); - n = Nibbler ("123 7b"); - t.ok (n.getHex (i), " '123 7b' : getHex () -> true"); - t.is (i, 291, " '123 7b' : getHex () -> '291'"); - t.ok (n.skip (' '), " ' 7b' : skip (' ') -> true"); - t.ok (n.getHex (i), " '7b' : getHex () -> true"); - t.is (i, 123, " '7b' : getHex () -> '123'"); - t.ok (n.depleted (), " '' : depleted () -> true"); - // bool getUnsignedInt (int&i); t.diag ("Nibbler::getUnsignedInt"); n = Nibbler ("123 4");