Ignore:
Timestamp:
Apr 28, 2011, 5:35:33 PM (9 years ago)
Author:
tbretz
Message:
Remove redundant trailing \0s from strings.
File:
1 edited

Legend:

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

    r10423 r10486  
    186186
    187187    return find(fAllowedStates.begin(), fAllowedStates.end(), state)!=fAllowedStates.end();
     188}
     189
     190// --------------------------------------------------------------------------
     191//
     192//! @returns the event data converted to a std::string. Trailing redundant
     193//!          \0's are removed.
     194//!
     195string EventImp::GetString() const
     196{
     197    size_t s = GetSize()-1;
     198    while (s>0 && GetText()[s]==0)
     199        s--;
     200
     201    return std::string(GetText(), s+1);
    188202}
    189203
Note: See TracChangeset for help on using the changeset viewer.