Advertisement
Guest User

Roman_int.h

a guest
Aug 8th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #ifndef ROMAN_INT_H_INCLUDED
  2. #define ROMAN_INT_H_INCLUDED
  3.  
  4. #include <array>
  5. #include <string>
  6. #include <cctype>
  7. #include <iostream>
  8. #include <stdexcept>
  9.  
  10. //------------------------------------------------------------------------------
  11.  
  12. const int NO_VALUE = -1;
  13.  
  14. class Roman_int {
  15. public:
  16.     Roman_int() :roman("") {}
  17.  
  18.     int as_int() const;
  19.  
  20.     friend std::istream& operator>>(std::istream& is, Roman_int& r);
  21.     friend std::ostream& operator<<(std::ostream& os, const Roman_int& r);
  22. private:
  23.     std::string roman;
  24. };
  25.  
  26. bool isValidNumeral(std::string& numeral);
  27. int valueof(const char c);
  28.  
  29. #endif // ROMAN_INT_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement