Home
last modified time | relevance | path

Searched refs:StringPiece (Results 1 – 25 of 38) sorted by relevance

12

/build/kati/
Dstrutil.h29 StringPiece operator*() const;
34 const StringPiece* in;
39 explicit WordScanner(StringPiece in);
44 void Split(vector<StringPiece>* o);
47 StringPiece in_;
54 void Write(StringPiece s);
64 explicit ScopedTerminator(StringPiece s);
68 StringPiece s_;
75 for (StringPiece s : v) { in JoinStrings()
84 void AppendString(StringPiece str, string* out);
[all …]
Dstring_piece_test.cc26 unordered_set<StringPiece> sps; in main()
27 sps.insert(StringPiece("foo")); in main()
28 sps.insert(StringPiece("foo")); in main()
29 sps.insert(StringPiece("bar")); in main()
31 assert(sps.count(StringPiece("foo")) == 1); in main()
32 assert(sps.count(StringPiece("bar")) == 1); in main()
34 assert(StringPiece("hogefugahige") == StringPiece("hogefugahige")); in main()
35 assert(StringPiece("hogefugahoge") != StringPiece("hogefugahige")); in main()
36 assert(StringPiece("hogefugahige") != StringPiece("higefugahige")); in main()
Dstring_piece.h44 class StringPiece {
64 StringPiece() : ptr_(NULL), length_(0) { } in StringPiece() function
65 StringPiece(const char* str) in StringPiece() function
67 StringPiece(const std::string& str) in StringPiece() function
69 StringPiece(const std::string&& str) in StringPiece() function
71 StringPiece(const char* offset, size_type len) in StringPiece() function
111 int compare(const StringPiece& x) const { in compare()
130 bool starts_with(const StringPiece& x) const { in starts_with()
136 bool ends_with(const StringPiece& x) const { in ends_with()
155 size_type find(const StringPiece& s, size_type pos = 0) const;
[all …]
Dstrutil.cc94 StringPiece WordScanner::Iterator::operator*() const { in operator *()
98 WordScanner::WordScanner(StringPiece in) in WordScanner()
119 void WordScanner::Split(vector<StringPiece>* o) { in Split()
120 for (StringPiece t : *this) in Split()
137 void WordWriter::Write(StringPiece s) { in Write()
142 ScopedTerminator::ScopedTerminator(StringPiece s) in ScopedTerminator()
151 void AppendString(StringPiece str, string* out) { in AppendString()
155 bool HasPrefix(StringPiece str, StringPiece prefix) { in HasPrefix()
160 bool HasSuffix(StringPiece str, StringPiece suffix) { in HasSuffix()
165 bool HasWord(StringPiece str, StringPiece w) { in HasWord()
[all …]
Dstring_piece.cc31 typedef StringPiece::size_type size_type;
33 bool operator==(const StringPiece& x, const StringPiece& y) { in operator ==()
44 return StringPiece::wordmemcmp(x.data(), y.data(), len) == 0; in operator ==()
47 void StringPiece::CopyToString(std::string* target) const { in CopyToString()
51 void StringPiece::AppendToString(std::string* target) const { in AppendToString()
56 size_type StringPiece::copy(char* buf, size_type n, size_type pos) const { in copy()
62 size_type StringPiece::find(const StringPiece& s, size_type pos) const { in find()
72 size_type StringPiece::find(char c, size_type pos) const { in find()
80 size_type StringPiece::rfind(const StringPiece& s, size_type pos) const { in rfind()
92 size_type StringPiece::rfind(char c, size_type pos) const { in rfind()
[all …]
Dparser.cc45 StringPiece line, StringPiece directive);
46 typedef unordered_map<StringPiece, DirectiveHandler> DirectiveMap;
49 Parser(StringPiece buf, const char* filename, vector<Stmt*>* stmts) in Parser()
60 Parser(StringPiece buf, const Loc& loc, vector<Stmt*>* stmts) in Parser()
81 StringPiece line(buf_.data() + l_, e - l_); in Parse()
158 Value* ParseExpr(StringPiece s, ParseExprOpt opt = ParseExprOpt::NORMAL) { in ParseExpr()
162 void ParseLine(StringPiece line) { in ParseLine()
194 void ParseRuleOrAssign(StringPiece line) { in ParseRuleOrAssign()
209 void ParseRule(StringPiece line, size_t sep) { in ParseRule()
249 void ParseAssign(StringPiece line, size_t sep) { in ParseAssign()
[all …]
Dparser.h29 void Parse(StringPiece buf, const Loc& loc, vector<Stmt*>* out_asts);
30 void ParseNotAfterRule(StringPiece buf, const Loc& loc,
33 void ParseAssignStatement(StringPiece line, size_t sep,
34 StringPiece* lhs, StringPiece* rhs, AssignOp* op);
Dstrutil_test.cc34 vector<StringPiece> ss; in TestWordScanner()
35 for (StringPiece tok : WordScanner("foo bar baz hogeeeeeeeeeeeeeeee")) { in TestWordScanner()
73 string SubstPattern(StringPiece str, StringPiece pat, StringPiece subst) { in SubstPattern()
153 ASSERT_EQ(FindEndOfLine(StringPiece(buf, 6), 0, &lf_cnt), 3); in TestFindEndOfLine()
154 ASSERT_EQ(FindEndOfLine(StringPiece(buf, 2), 0, &lf_cnt), 2); in TestFindEndOfLine()
187 vector<StringPiece> ss; in TestWordScannerInvalidAccess()
188 for (StringPiece tok : WordScanner(CreateProtectedString("0123 456789"))) { in TestWordScannerInvalidAccess()
Drule.cc28 static void ParseInputs(Rule* r, StringPiece s) { in ParseInputs()
30 for (StringPiece input : WordScanner(s)) { in ParseInputs()
44 bool IsPatternRule(StringPiece s) { in IsPatternRule()
56 void ParseRule(Loc& loc, StringPiece line, char term, in ParseRule()
64 StringPiece first = line.substr(0, index); in ParseRule()
66 for (StringPiece tok : WordScanner(first)) { in ParseRule()
85 StringPiece rest = line.substr(index); in ParseRule()
141 StringPiece second = rest.substr(0, index); in ParseRule()
142 StringPiece third = rest.substr(index+1); in ParseRule()
144 for (StringPiece tok : WordScanner(second)) { in ParseRule()
Dtestutil.h31 StringPiece GetStringPiece(StringPiece s) { return s; } in GetStringPiece()
32 StringPiece GetStringPiece(size_t v) { in GetStringPiece()
Dfunc.cc105 for (StringPiece tok : WordScanner(str)) { in PatsubstFunc()
114 for (StringPiece tok : WordScanner(str)) { in StripFunc()
133 AppendString(StringPiece(str).substr(index, found - index), s); in SubstFunc()
137 AppendString(StringPiece(str).substr(index), s); in SubstFunc()
151 for (StringPiece pat : WordScanner(pat_buf)) { in FilterFunc()
155 for (StringPiece tok : WordScanner(text)) { in FilterFunc()
169 for (StringPiece pat : WordScanner(pat_buf)) { in FilterOutFunc()
173 for (StringPiece tok : WordScanner(text)) { in FilterOutFunc()
192 vector<StringPiece> toks; in SortFunc()
196 StringPiece prev; in SortFunc()
[all …]
Dexpr.h46 virtual StringPiece GetLiteralValueUnsafe() const { return ""; } in GetLiteralValueUnsafe()
62 Value* ParseExprImpl(const Loc& loc, StringPiece s, const char* terms,
65 Value* ParseExpr(const Loc& loc, StringPiece s,
73 Value* NewLiteral(StringPiece s);
Dninja.cc49 static size_t FindCommandLineFlag(StringPiece cmd, StringPiece name) { in FindCommandLineFlag()
56 static StringPiece FindCommandLineFlagWithArg(StringPiece cmd, in FindCommandLineFlagWithArg()
57 StringPiece name) { in FindCommandLineFlagWithArg()
60 return StringPiece(); in FindCommandLineFlagWithArg()
62 StringPiece val = TrimLeftSpace(cmd.substr(index + name.size())); in FindCommandLineFlagWithArg()
73 static bool StripPrefix(StringPiece p, StringPiece* s) { in StripPrefix()
80 size_t GetGomaccPosForAndroidCompileCommand(StringPiece cmdline) { in GetGomaccPosForAndroidCompileCommand()
84 StringPiece cmd = cmdline.substr(0, index); in GetGomaccPosForAndroidCompileCommand()
99 StringPiece rest = cmdline.substr(index); in GetGomaccPosForAndroidCompileCommand()
103 static bool GetDepfileFromCommandImpl(StringPiece cmd, string* out) { in GetDepfileFromCommandImpl()
[all …]
Drule.h58 StringPiece lhs;
59 StringPiece rhs;
67 void ParseRule(Loc& loc, StringPiece line, char term,
Dvar.h55 virtual StringPiece String() const = 0;
85 virtual StringPiece String() const override;
98 RecursiveVar(Value* v, VarOrigin origin, StringPiece orig);
111 virtual StringPiece String() const override;
118 StringPiece orig_;
135 virtual StringPiece String() const override;
165 virtual StringPiece String() const override { in String()
Dvar.cc69 StringPiece SimpleVar::String() const { in String()
77 RecursiveVar::RecursiveVar(Value* v, VarOrigin origin, StringPiece orig) in RecursiveVar()
89 StringPiece RecursiveVar::String() const { in String()
103 StringPiece UndefinedVar::String() const { in String()
104 return StringPiece(""); in String()
Dstmt.h56 StringPiece orig() const { return orig_; } in orig()
67 StringPiece orig_;
85 StringPiece orig_rhs;
106 StringPiece orig;
Dexpr.cc55 explicit Literal(StringPiece s) in Literal()
59 StringPiece val() const { return s_; } in val()
66 virtual StringPiece GetLiteralValueUnsafe() const override { return s_; } in GetLiteralValueUnsafe()
73 StringPiece s_;
194 for (StringPiece tok : WordScanner(value)) { in Eval()
262 static size_t SkipSpaces(StringPiece s, const char* terms) { in SkipSpaces()
283 Func* f, StringPiece s, size_t i, char* terms, in ParseFunc()
343 Value* ParseDollar(const Loc& loc, StringPiece s, size_t* index_out) { in ParseDollar()
441 StringPiece s, const char* terms, ParseExprOpt opt, in ParseExprImpl()
478 r->AddValue(new Literal(StringPiece("$"))); in ParseExprImpl()
[all …]
Dcommand.cc42 virtual StringPiece String() const override { in String()
109 unordered_set<StringPiece> seen; in Eval()
141 for (StringPiece tok : WordScanner(buf)) { in Eval()
150 for (StringPiece tok : WordScanner(buf)) { in Eval()
155 void ParseCommandPrefixes(StringPiece* s, bool* echo, bool* ignore_error) { in ParseCommandPrefixes()
199 StringPiece cmds = cmds_buf; in Eval()
210 StringPiece cmd = TrimLeftSpace(cmds.substr(0, index)); in Eval()
Dfileutil.h29 bool Exists(StringPiece f);
31 double GetTimestamp(StringPiece f);
Dfind.cc150 virtual const DirentNode* FindDir(StringPiece) const { in FindDir()
242 virtual const DirentNode* FindDir(StringPiece d) const override { in FindDir()
251 StringPiece nd = d.substr(index + 1); in FindDir()
357 virtual const DirentNode* FindDir(StringPiece d) const override { in FindDir()
407 FindCommandParser(StringPiece cmd, FindCommand* fc) in FindCommandParser()
422 bool GetNextToken(StringPiece* tok) { in GetNextToken()
465 void UngetToken(StringPiece tok) { in UngetToken()
474 StringPiece tok; in ParseTest()
483 FindCond* ParseFact(StringPiece tok) { in ParseFact()
530 FindCond* ParseTerm(StringPiece tok) { in ParseTerm()
[all …]
Dlog.cc34 StringPiece filtered = TrimPrefix(msg, "*** "); in ColorErrorLog()
50 StringPiece filtered = TrimPrefix(msg, "*warning*: "); in ColorWarnLog()
Dsymtab.cc134 Symbol InternImpl(StringPiece s) { in InternImpl()
146 Symbol Intern(StringPiece s) { in Intern()
159 unordered_map<StringPiece, Symbol> symtab_;
176 Symbol Intern(StringPiece s) { in Intern()
Ddep.cc76 Entry(const Rule* r, StringPiece s) in Entry()
80 StringPiece suffix;
90 void Add(StringPiece name, const Rule* rule) { in Add()
103 void Get(StringPiece name, vector<const Rule*>* rules) const { in Get()
134 const StringPiece rest = StringPiece(output.str()).substr(1); in IsSuffixRule()
389 const StringPiece rest = StringPiece(output.str()).substr(1); in PopulateSuffixRule()
392 StringPiece input_suffix = rest.substr(0, dot_index); in PopulateSuffixRule()
393 StringPiece output_suffix = rest.substr(dot_index+1); in PopulateSuffixRule()
531 StringPiece output_suffix = GetExt(output.str()); in PickRule()
651 typedef unordered_map<StringPiece, vector<shared_ptr<Rule>>> SuffixRuleMap;
Deval.cc50 Var* Evaluator::EvalRHS(Symbol lhs, Value* rhs_v, StringPiece orig_rhs, in EvalRHS()
183 rhs = NewExpr3(lit, NewLiteral(StringPiece(" ; ")), rhs); in EvalRule()
185 rhs = NewExpr3(lit, NewLiteral(StringPiece(" = ")), rhs); in EvalRule()
208 Var* rhs_var = EvalRHS(lhs, rhs, StringPiece("*TODO*"), rule_var.op); in EvalRule()
296 for (StringPiece pat : WordScanner(pats)) { in EvalInclude()
323 for (StringPiece tok : WordScanner(exports)) { in EvalExport()
333 StringPiece lhs, rhs; in EvalExport()

12