Changeset 735


Ignore:
Timestamp:
May 20, 2003, 10:30:23 AM (18 years ago)
Author:
luba
Message:
  • file formatting is corrected, modificator const is added to methods
Location:
to-imperative/trunk/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/runtime/rf_word.hh

    r733 r735  
    6464  public:
    6565    inline NumIterator(Word const& _word) ;
    66     inline NumIterator& operator ++() ;
     66    inline NumIterator& operator ++(int) ;
    6767    inline NumIterator const& operator =(Word const& _word) ;
    68     inline bool in_bounds () ;
    69     inline const wchar_t operator*() ;
     68    inline bool in_bounds () const;
     69    inline const wchar_t operator*() const;
    7070  };
    7171 
  • to-imperative/trunk/runtime/rf_word.ih

    r733 r735  
    8585}
    8686
    87 inline size_t Word::get_len () {
     87inline size_t Word::get_len ()
     88{
    8889  return static_cast<Header*>(ptr_data2)->length;
    8990}
    9091
    91 inline int Word::is_number () {
     92inline int Word::is_number ()
     93{
    9294  int res = 1;
    9395  size_t i = 0;
     
    99101  for (; i < h->length; i++)
    100102    if (iswdigit(h->content[i]) == 0) {
    101       res = 0; break;
     103      res = 0;
     104      break;
    102105    }
    103106  return res;
     
    108111//
    109112
    110 inline Word::NumIterator::NumIterator(Word const& _word) {
     113inline Word::NumIterator::NumIterator(Word const& _word)
     114{
    111115  Header* h = static_cast<Header*>(_word.ptr_data2);
    112116  if (*(h->content) == '+' || *(h->content) == '-')
     
    114118  else
    115119    iter = h->content;
    116     bound = h->content + h->length;
    117   }
     120  bound = h->content + h->length;
     121}
    118122
    119 inline Word::NumIterator& Word::NumIterator::operator ++() {
     123inline Word::NumIterator& Word::NumIterator::operator ++(int)
     124{
    120125  iter++;     
    121126  return *this;
    122   };
     127};
    123128
    124129inline Word::NumIterator const& Word::NumIterator::operator = (Word const& _word) {
     
    126131  if (*(h->content) == '+' || *(h->content) == '-')
    127132    iter = h->content + 1;
    128     else
    129       iter = h->content;
    130     return *this;
    131   };
     133  else
     134    iter = h->content;
     135  return *this;
     136};
    132137
    133 inline bool Word::NumIterator::in_bounds () {
     138inline bool Word::NumIterator::in_bounds () const
     139{
    134140  if (iter > bound ) return false;
    135   else return true;
     141  else
     142  return true;
    136143}
    137144
    138 inline const wchar_t Word::NumIterator::operator * () {
     145inline const wchar_t Word::NumIterator::operator * () const
     146{
    139147  return *iter;
    140148}
Note: See TracChangeset for help on using the changeset viewer.