OLD | NEW |
1 // Copyright 2007, Google Inc. | 1 // Copyright 2007, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 compare, found_scheme); | 63 compare, found_scheme); |
64 } | 64 } |
65 inline bool FindAndCompareScheme(const string16& str, | 65 inline bool FindAndCompareScheme(const string16& str, |
66 const char* compare, | 66 const char* compare, |
67 url_parse::Component* found_scheme) { | 67 url_parse::Component* found_scheme) { |
68 return FindAndCompareScheme(str.data(), static_cast<int>(str.size()), | 68 return FindAndCompareScheme(str.data(), static_cast<int>(str.size()), |
69 compare, found_scheme); | 69 compare, found_scheme); |
70 } | 70 } |
71 | 71 |
72 // Returns true if the given string represents a standard URL. This means that | 72 // Returns true if the given string represents a standard URL. This means that |
73 // either the scheme is in the list of known standard schemes, or there is a | 73 // either the scheme is in the list of known standard schemes. |
74 // "://" following the scheme. | 74 bool IsStandard(const char* spec, const url_parse::Component& scheme); |
75 bool IsStandard(const char* spec, int spec_len, | 75 bool IsStandard(const char16* spec, const url_parse::Component& scheme); |
76 const url_parse::Component& scheme); | |
77 bool IsStandard(const char16* spec, int spec_len, | |
78 const url_parse::Component& scheme); | |
79 | 76 |
80 // URL library wrappers ------------------------------------------------------- | 77 // URL library wrappers ------------------------------------------------------- |
81 | 78 |
82 // Parses the given spec according to the extracted scheme type. Normal users | 79 // Parses the given spec according to the extracted scheme type. Normal users |
83 // should use the URL object, although this may be useful if performance is | 80 // should use the URL object, although this may be useful if performance is |
84 // critical and you don't want to do the heap allocation for the std::string. | 81 // critical and you don't want to do the heap allocation for the std::string. |
85 // | 82 // |
86 // As with the url_canon::Canonicalize* functions, the charset converter can | 83 // As with the url_canon::Canonicalize* functions, the charset converter can |
87 // be NULL to use UTF-8 (it will be faster in this case). | 84 // be NULL to use UTF-8 (it will be faster in this case). |
88 // | 85 // |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const char* a_end, | 158 const char* a_end, |
162 const char* b_begin, | 159 const char* b_begin, |
163 const char* b_end); | 160 const char* b_end); |
164 bool LowerCaseEqualsASCII(const char16* a_begin, | 161 bool LowerCaseEqualsASCII(const char16* a_begin, |
165 const char16* a_end, | 162 const char16* a_end, |
166 const char* b); | 163 const char* b); |
167 | 164 |
168 } // namespace url_util | 165 } // namespace url_util |
169 | 166 |
170 #endif // GOOGLEURL_SRC_URL_UTIL_H__ | 167 #endif // GOOGLEURL_SRC_URL_UTIL_H__ |
OLD | NEW |