#include <string_piece.hh>
Public Types | |
| typedef size_t | size_type |
| typedef char | value_type |
| typedef const char * | pointer |
| typedef const char & | reference |
| typedef const char & | const_reference |
| typedef ptrdiff_t | difference_type |
| typedef const char * | const_iterator |
| typedef const char * | iterator |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
Public Member Functions | |
| StringPiece () | |
| StringPiece (const char *str) | |
| StringPiece (const std::string &str) | |
| StringPiece (const char *offset, size_type len) | |
| const char * | data () const |
| size_type | size () const |
| size_type | length () const |
| bool | empty () const |
| void | clear () |
| void | set (const char *data, size_type len) |
| void | set (const char *str) |
| void | set (const void *data, size_type len) |
| char | operator[] (size_type i) const |
| void | remove_prefix (size_type n) |
| void | remove_suffix (size_type n) |
| int | compare (const StringPiece &x) const |
| std::string | as_string () const |
| void | CopyToString (std::string *target) const |
| void | AppendToString (std::string *target) const |
| bool | starts_with (const StringPiece &x) const |
| bool | ends_with (const StringPiece &x) const |
| iterator | begin () const |
| iterator | end () const |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| size_type | max_size () const |
| size_type | capacity () const |
| size_type | copy (char *buf, size_type n, size_type pos=0) const |
| size_type | find (const StringPiece &s, size_type pos=0) const |
| size_type | find (char c, size_type pos=0) const |
| size_type | rfind (const StringPiece &s, size_type pos=npos) const |
| size_type | rfind (char c, size_type pos=npos) const |
| size_type | find_first_of (const StringPiece &s, size_type pos=0) const |
| size_type | find_first_of (char c, size_type pos=0) const |
| size_type | find_first_not_of (const StringPiece &s, size_type pos=0) const |
| size_type | find_first_not_of (char c, size_type pos=0) const |
| size_type | find_last_of (const StringPiece &s, size_type pos=npos) const |
| size_type | find_last_of (char c, size_type pos=npos) const |
| size_type | find_last_not_of (const StringPiece &s, size_type pos=npos) const |
| size_type | find_last_not_of (char c, size_type pos=npos) const |
| StringPiece | substr (size_type pos, size_type n=npos) const |
Static Public Member Functions | |
| static int | wordmemcmp (const char *p, const char *p2, size_type N) |
Static Public Attributes | |
| static const size_type | npos = size_type(-1) |
Definition at line 89 of file string_piece.hh.
| typedef const char* StringPiece::const_iterator |
Definition at line 176 of file string_piece.hh.
| typedef const char& StringPiece::const_reference |
Definition at line 173 of file string_piece.hh.
| typedef std::reverse_iterator<const_iterator> StringPiece::const_reverse_iterator |
Definition at line 178 of file string_piece.hh.
| typedef ptrdiff_t StringPiece::difference_type |
Definition at line 174 of file string_piece.hh.
| typedef const char* StringPiece::iterator |
Definition at line 177 of file string_piece.hh.
| typedef const char* StringPiece::pointer |
Definition at line 171 of file string_piece.hh.
| typedef const char& StringPiece::reference |
Definition at line 172 of file string_piece.hh.
| typedef std::reverse_iterator<iterator> StringPiece::reverse_iterator |
Definition at line 179 of file string_piece.hh.
| typedef size_t StringPiece::size_type |
Definition at line 91 of file string_piece.hh.
| typedef char StringPiece::value_type |
Definition at line 170 of file string_piece.hh.
| StringPiece::StringPiece | ( | ) | [inline] |
Definition at line 101 of file string_piece.hh.
Referenced by substr().

| StringPiece::StringPiece | ( | const char * | str | ) | [inline] |
Definition at line 102 of file string_piece.hh.
| StringPiece::StringPiece | ( | const std::string & | str | ) | [inline] |
Definition at line 104 of file string_piece.hh.
| StringPiece::StringPiece | ( | const char * | offset, | |
| size_type | len | |||
| ) | [inline] |
Definition at line 106 of file string_piece.hh.
| void StringPiece::AppendToString | ( | std::string * | target | ) | const |
| std::string StringPiece::as_string | ( | ) | const [inline] |
Definition at line 149 of file string_piece.hh.
References data(), empty(), and size().
Referenced by Moses::LanguageModelIRST::GetLmID(), GrabOrDie(), main(), Moses::TargetPhrase::SetSparseScore(), and split_line().


| iterator StringPiece::begin | ( | ) | const [inline] |
Definition at line 180 of file string_piece.hh.
| size_type StringPiece::capacity | ( | ) | const [inline] |
Definition at line 190 of file string_piece.hh.
| void StringPiece::clear | ( | ) | [inline] |
Definition at line 118 of file string_piece.hh.
References NULL.
Referenced by split_line().

| int StringPiece::compare | ( | const StringPiece & | x | ) | const [inline] |
Definition at line 140 of file string_piece.hh.
References wordmemcmp().
Referenced by Moses::TargetNgramFeature::EvaluateChart(), ModelScoreMonotonicity::getType(), ModelScoreMSD::getType(), ModelScoreLR::getType(), ModelScoreMSLR::getType(), ModelScore::getType(), and main().


| void StringPiece::CopyToString | ( | std::string * | target | ) | const |
Definition at line 15 of file string_piece.cc.
| const char* StringPiece::data | ( | ) | const [inline] |
Definition at line 113 of file string_piece.hh.
Referenced by lm::ngram::WriteWordsWrapper::Add(), Moses::FactorCollection::AddFactor(), lm::InputBuffer::AddNGram(), as_string(), Moses::Phrase::CreateFromString(), Moses::TargetBigramFeature::Evaluate(), Moses::GlobalLexicalModelUnlimited::Evaluate(), util::AnyCharacterLast::Find(), util::AnyCharacter::Find(), util::MultiCharacter::Find(), util::SingleCharacter::Find(), FindStringPiece(), Moses::FName::FName(), hash_value(), lm::ngram::detail::HashForVocab(), lm::ngram::SortedVocabulary::Insert(), lm::IsEntirelyWhiteSpace(), lm::vocab::IsTag(), Moses::RuleTableLoaderStandard::Load(), util::TokenIter< Find, SkipEmpty >::operator bool(), util::TokenIter< Find, SkipEmpty >::operator!(), operator<(), operator<<(), util::FakeOFStream::operator<<(), operator==(), MosesTuning::ParseFloat(), MosesTuning::ParseInt(), lm::ReadARPACounts(), set(), lm::MultipleOutputBuffer::SingleAddNGram(), and split_line().

| bool StringPiece::empty | ( | ) | const [inline] |
Definition at line 116 of file string_piece.hh.
Referenced by as_string(), and lm::vocab::IsTag().

| iterator StringPiece::end | ( | ) | const [inline] |
Definition at line 181 of file string_piece.hh.
| bool StringPiece::ends_with | ( | const StringPiece & | x | ) | const [inline] |
Definition at line 164 of file string_piece.hh.
References wordmemcmp().

| size_type StringPiece::find | ( | const StringPiece & | s, | |
| size_type | pos = 0 | |||
| ) | const |
Definition at line 19 of file string_piece.cc.
References npos.
Referenced by Moses::Phrase::CreateFromString(), Moses::WordTranslationFeature::Evaluate(), find(), and find_first_of().

| size_type StringPiece::find_first_not_of | ( | const StringPiece & | s, | |
| size_type | pos = 0 | |||
| ) | const |
Definition at line 95 of file string_piece.cc.
References npos.
Referenced by Moses::RuleTableLoaderStandard::Load().

Definition at line 200 of file string_piece.hh.
References find().

| size_type StringPiece::find_first_of | ( | const StringPiece & | s, | |
| size_type | pos = 0 | |||
| ) | const |
Definition at line 76 of file string_piece.cc.
References npos.
Referenced by Moses::ChartParserUnknown::Process(), and Moses::TranslationOptionCollection::ProcessOneUnknownWord().

| size_type StringPiece::find_last_not_of | ( | const StringPiece & | s, | |
| size_type | pos = npos | |||
| ) | const |
Definition at line 206 of file string_piece.hh.
References rfind().

| size_type StringPiece::find_last_of | ( | const StringPiece & | s, | |
| size_type | pos = npos | |||
| ) | const |
| size_type StringPiece::length | ( | ) | const [inline] |
Definition at line 115 of file string_piece.hh.
Referenced by hash_value(), lm::ngram::detail::HashForVocab(), and lm::MultipleOutputBuffer::SingleAddNGram().

| size_type StringPiece::max_size | ( | ) | const [inline] |
Definition at line 189 of file string_piece.hh.
| char StringPiece::operator[] | ( | size_type | i | ) | const [inline] |
Definition at line 129 of file string_piece.hh.
| const_reverse_iterator StringPiece::rbegin | ( | ) | const [inline] |
Definition at line 182 of file string_piece.hh.
| void StringPiece::remove_prefix | ( | size_type | n | ) | [inline] |
Definition at line 131 of file string_piece.hh.
| void StringPiece::remove_suffix | ( | size_type | n | ) | [inline] |
Definition at line 136 of file string_piece.hh.
| const_reverse_iterator StringPiece::rend | ( | ) | const [inline] |
Definition at line 185 of file string_piece.hh.
| size_type StringPiece::rfind | ( | const StringPiece & | s, | |
| size_type | pos = npos | |||
| ) | const |
Definition at line 38 of file string_piece.cc.
References npos.
Referenced by find_last_of().

| void StringPiece::set | ( | const void * | data, | |
| size_type | len | |||
| ) | [inline] |
Definition at line 124 of file string_piece.hh.
References data().

| void StringPiece::set | ( | const char * | str | ) | [inline] |
Definition at line 120 of file string_piece.hh.
| void StringPiece::set | ( | const char * | data, | |
| size_type | len | |||
| ) | [inline] |
Definition at line 119 of file string_piece.hh.
References data().

| size_type StringPiece::size | ( | ) | const [inline] |
Definition at line 114 of file string_piece.hh.
Referenced by lm::ngram::WriteWordsWrapper::Add(), Moses::FactorCollection::AddFactor(), lm::InputBuffer::AddNGram(), as_string(), Moses::Phrase::CreateFromString(), Moses::TargetBigramFeature::Evaluate(), Moses::GlobalLexicalModelUnlimited::Evaluate(), util::AnyCharacterLast::Find(), util::AnyCharacter::Find(), util::MultiCharacter::Find(), util::SingleCharacter::Find(), FindStringPiece(), Moses::FName::FName(), lm::ngram::SortedVocabulary::Insert(), lm::IsEntirelyWhiteSpace(), lm::vocab::IsTag(), Moses::RuleTableLoaderStandard::Load(), operator<(), operator<<(), util::FakeOFStream::operator<<(), operator==(), and lm::ReadARPACounts().

| bool StringPiece::starts_with | ( | const StringPiece & | x | ) | const [inline] |
Definition at line 158 of file string_piece.hh.
References wordmemcmp().
Referenced by lm::ReadARPACounts().


| StringPiece StringPiece::substr | ( | size_type | pos, | |
| size_type | n = npos | |||
| ) | const |
Definition at line 185 of file string_piece.cc.
References StringPiece().
Referenced by Moses::Phrase::CreateFromString().


| static int StringPiece::wordmemcmp | ( | const char * | p, | |
| const char * | p2, | |||
| size_type | N | |||
| ) | [inline, static] |
Definition at line 214 of file string_piece.hh.
Referenced by compare(), ends_with(), and starts_with().

const size_type StringPiece::npos = size_type(-1) [static] |
Definition at line 175 of file string_piece.hh.
Referenced by find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), and rfind().
1.5.9