proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
UtilInl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-present, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
*/
10
#pragma once
11
12
#include <
folly/Range.h
>
13
14
namespace
proxygen
{
15
16
// Case-insensitive string comparison
17
inline
bool
caseInsensitiveEqual
(
folly::StringPiece
s
,
folly::StringPiece
t
) {
18
if
(s.
size
() != t.
size
()) {
19
return
false
;
20
}
21
return
std::equal(
22
s.
begin
(), s.
end
(), t.
begin
(),
folly::AsciiCaseInsensitive
());
23
}
24
25
inline
bool
validateURL
(
folly::ByteRange
url) {
26
for
(
auto
p: url) {
27
if
(p <= 0x20 || p == 0x7f) {
28
// no controls or unescaped spaces
29
return
false
;
30
}
31
}
32
return
true
;
33
}
34
}
proxygen::caseInsensitiveEqual
bool caseInsensitiveEqual(folly::StringPiece s, folly::StringPiece t)
Definition:
UtilInl.h:17
folly::Range::size
constexpr size_type size() const
Definition:
Range.h:431
proxygen::validateURL
bool validateURL(folly::ByteRange url)
Definition:
UtilInl.h:25
Range.h
folly::Range< const char * >
folly::Range::end
constexpr Iter end() const
Definition:
Range.h:455
folly::Range::begin
constexpr Iter begin() const
Definition:
Range.h:452
s
static set< string > s
Definition:
StringKeyedBenchmark.cpp:48
proxygen
Definition:
ExMessageHandler.h:14
folly::pushmi::detail::t
requires Tuple && t
Definition:
extension_operators.h:48
folly::AsciiCaseInsensitive
Definition:
Range.h:1381
proxygen
lib
utils
UtilInl.h
Generated by
1.8.11