File tree 8 files changed +26
-16
lines changed
8 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 17
17
18
18
#include " src/utils/string.h"
19
19
20
+ using namespace modsecurity ::utils::string;
20
21
21
22
namespace modsecurity ::actions::transformations {
22
23
Original file line number Diff line number Diff line change 17
17
18
18
#include " src/utils/string.h"
19
19
20
+ using namespace modsecurity ::utils::string;
21
+
20
22
namespace modsecurity ::actions::transformations {
21
23
22
24
Original file line number Diff line number Diff line change 23
23
#include " src/compat/msvc.h"
24
24
#endif
25
25
26
+ using namespace modsecurity ::utils::string;
26
27
27
28
namespace modsecurity ::actions::transformations {
28
29
Original file line number Diff line number Diff line change 17
17
18
18
#include " src/utils/string.h"
19
19
20
+ using namespace modsecurity ::utils::string;
20
21
21
22
namespace modsecurity ::actions::transformations {
22
23
Original file line number Diff line number Diff line change 19
19
20
20
#include " src/utils/string.h"
21
21
22
+ using namespace modsecurity ::utils::string;
22
23
23
24
namespace modsecurity ::actions::transformations {
24
25
Original file line number Diff line number Diff line change 18
18
#include " modsecurity/rules_set.h"
19
19
#include " src/utils/string.h"
20
20
21
+ using namespace modsecurity ::utils::string;
21
22
22
23
namespace modsecurity ::actions::transformations {
23
24
Original file line number Diff line number Diff line change 17
17
#include " modsecurity/modsecurity.h"
18
18
#include " src/utils/string.h"
19
19
20
+ using namespace modsecurity ::utils::string;
20
21
21
- namespace modsecurity {
22
- namespace utils {
22
+ namespace modsecurity ::utils {
23
23
24
24
25
25
bool urldecode_nonstrict_inplace (std::string &val,
@@ -112,5 +112,4 @@ std::string uri_decode(const std::string & sSrc) {
112
112
}
113
113
114
114
115
- } // namespace utils
116
- } // namespace modsecurity
115
+ } // namespace modsecurity::utils
Original file line number Diff line number Diff line change 13
13
*
14
14
*/
15
15
16
+ #ifndef SRC_UTILS_STRING_H_
17
+ #define SRC_UTILS_STRING_H_
18
+
16
19
#include < ctime>
17
20
#include < string>
18
21
#include < cstring>
27
30
#include " src/compat/msvc.h"
28
31
#endif
29
32
30
- #ifndef SRC_UTILS_STRING_H_
31
- #define SRC_UTILS_STRING_H_
33
+ namespace modsecurity ::utils::string {
32
34
33
- #define VALID_HEX (X ) (((X >= ' 0' ) && (X <= ' 9' )) || \
34
- ((X >= ' a' ) && (X <= ' f' )) || ((X >= ' A' ) && (X <= ' F' )))
35
- #define ISODIGIT (X ) ((X >= ' 0' ) && (X <= ' 7' ))
36
- #define NBSP 160
35
+ template <typename CharT>
36
+ constexpr bool VALID_HEX (CharT X) {
37
+ return ((X >= ' 0' ) && (X <= ' 9' ))
38
+ || ((X >= ' a' ) && (X <= ' f' ))
39
+ || ((X >= ' A' ) && (X <= ' F' ));
40
+ }
37
41
42
+ template <typename CharT>
43
+ constexpr bool ISODIGIT (CharT X) {
44
+ return (X >= ' 0' ) && (X <= ' 7' );
45
+ }
38
46
39
- namespace modsecurity {
40
- namespace utils {
41
- namespace string {
47
+ constexpr char NBSP = 160 ;
42
48
43
49
const char HEX2DEC[256 ] = {
44
50
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
@@ -271,8 +277,6 @@ inline std::string toupper(std::string str) { // cppcheck-suppress passedByValue
271
277
}
272
278
273
279
274
- } // namespace string
275
- } // namespace utils
276
- } // namespace modsecurity
280
+ } // namespace modsecurity::utils::string
277
281
278
282
#endif // SRC_UTILS_STRING_H_
You can’t perform that action at this time.
0 commit comments