Changeset 10293 for trunk/FACT++/src


Ignore:
Timestamp:
04/07/11 08:42:04 (14 years ago)
Author:
tbretz
Message:
Fixed the conversion for cases like 'C:5'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Converter.cc

    r10289 r10293  
    4848strict argument in the constructor.
    4949
     50@remark Note that all values are interpreted as signed, except the single
     51char (e.g. C:5)
     52
    5053*/
    5154// **************************************************************************
     
    528531            switch (i->first.first->name()[0])
    529532            {
    530             case 'c': // Skip whitespaces when checking for characters
    531                 if (j>0)
    532                     line >> noskipws;
    533                 GetBinImp(data, Get<char>(line));
    534                 line >> skipws;
    535                 break;
    536533            case 'b': GetBinImp(data, GetBool(line)); break;
    537534            case 's': GetBinImp(data, Get<short>    (line)); break;
     
    541538            case 'd': GetBinImp(data, Get<double>   (line)); break;
    542539            case 'x': GetBinImp(data, Get<long long>(line)); break;
     540            case 'c':
     541                if (line.peek()==-1)
     542                {
     543                    line.clear(ios::failbit|ios::eofbit);
     544                    break;
     545                }
     546                GetBinImp(data, Get<unsigned char>(line));
     547                if (line.peek()==-1)
     548                    line.clear(ios::eofbit);
     549                break;
    543550            case 'N':
    544551                GetBinString(data, GetString(line));
     
    554561        }
    555562
    556         //wout << "{" << line.eof() << line.good() << line.fail() << "}";
    557563        if (!line)
    558564            break;
Note: See TracChangeset for help on using the changeset viewer.