Lines Matching refs:string
8 #include <string>
18 // This is a macro to support extending this string literal at compile time.
28 static std::string PathForRequest(const GURL& url);
33 static std::string SpecForRequest(const GURL& url);
37 // within a quoted string). Returns the offset of the found delimiter or
39 static size_t FindDelimiter(const std::string& line,
49 static void ParseContentType(const std::string& content_type_str,
50 std::string* mime_type,
51 std::string* charset,
53 std::string* boundary);
61 static bool ParseRanges(const std::string& headers,
65 // is directly passed in, rather than requiring searching through a string.
66 static bool ParseRangeHeader(const std::string& range_specifier,
72 static bool HasHeader(const std::string& headers, const char* name);
76 static bool IsSafeHeader(const std::string& name);
79 static bool IsValidHeaderName(const std::string& name);
83 static bool IsValidHeaderValue(const std::string& value);
89 static std::string StripHeaders(const std::string& headers,
96 static bool IsNonCoalescingHeader(std::string::const_iterator name_begin,
97 std::string::const_iterator name_end);
98 static bool IsNonCoalescingHeader(const std::string& name) {
107 // Trim HTTP_LWS chars from the beginning and end of the string.
108 static void TrimLWS(std::string::const_iterator* begin,
109 std::string::const_iterator* end);
114 // Whether the string is a valid |token| as defined in RFC 2616 Sec 2.2.
115 static bool IsToken(std::string::const_iterator begin,
116 std::string::const_iterator end);
117 static bool IsToken(const std::string& str) {
122 // quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
123 // Unquote() strips the surrounding quotemarks off a string, and unescapes
124 // any quoted-pair to obtain the value contained by the quoted-string.
126 static std::string Unquote(std::string::const_iterator begin,
127 std::string::const_iterator end);
130 static std::string Unquote(const std::string& str);
133 static std::string Quote(const std::string& str);
161 static std::string AssembleRawHeaders(const char* buf, int buf_len);
167 static std::string ConvertHeadersBackToHTTPResponse(const std::string& str);
183 static std::string GenerateAcceptLanguageHeader(
184 const std::string& raw_language_list);
189 const std::string& header_value,
190 std::string* headers);
195 const std::string& etag_header,
196 const std::string& last_modified_header,
197 const std::string& date_header);
214 HeadersIterator(std::string::const_iterator headers_begin,
215 std::string::const_iterator headers_end,
216 const std::string& line_delimiter);
236 std::string::const_iterator name_begin() const {
239 std::string::const_iterator name_end() const {
242 std::string name() const {
243 return std::string(name_begin_, name_end_);
246 std::string::const_iterator values_begin() const {
249 std::string::const_iterator values_end() const {
252 std::string values() const {
253 return std::string(values_begin_, values_end_);
258 std::string::const_iterator name_begin_;
259 std::string::const_iterator name_end_;
260 std::string::const_iterator values_begin_;
261 std::string::const_iterator values_end_;
273 // quoted string.
277 ValuesIterator(std::string::const_iterator values_begin,
278 std::string::const_iterator values_end,
286 std::string::const_iterator value_begin() const {
289 std::string::const_iterator value_end() const {
292 std::string value() const {
293 return std::string(value_begin_, value_end_);
298 std::string::const_iterator value_begin_;
299 std::string::const_iterator value_end_;
304 // token or quoted-string (the value). Arbitrary HTTP LWS is permitted outside
307 // String iterators returned from this class' methods may be invalidated upon
311 NameValuePairsIterator(std::string::const_iterator begin,
312 std::string::const_iterator end,
325 std::string::const_iterator name_begin() const { return name_begin_; }
326 std::string::const_iterator name_end() const { return name_end_; }
327 std::string name() const { return std::string(name_begin_, name_end_); }
330 std::string::const_iterator value_begin() const {
333 std::string::const_iterator value_end() const {
336 std::string value() const {
337 return value_is_quoted_ ? unquoted_value_ : std::string(value_begin_,
342 std::string raw_value() const { return std::string(value_begin_,
349 std::string::const_iterator name_begin_;
350 std::string::const_iterator name_end_;
352 std::string::const_iterator value_begin_;
353 std::string::const_iterator value_end_;
355 // Do not store iterators into this string. The NameValuePairsIterator
358 std::string unquoted_value_;