Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
string.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#ifndef ADOBE_STRING_HPP
9#define ADOBE_STRING_HPP
10
11#include <adobe/config.hpp>
12
13#include <cstring>
14#include <functional>
15#include <iterator>
16#include <string>
17#include <vector>
18
19#if defined(ADOBE_STD_SERIALIZATION)
20#include <iosfwd>
21#endif
22
24
25/**************************************************************************************************/
26
27namespace adobe {
28
29/**************************************************************************************************/
30
31inline std::string make_string(const char* a, const char* b) {
32 std::string result;
33 result.reserve(std::strlen(a) + std::strlen(b));
34 result += a;
35 result += b;
36 return result;
37}
38
39/**************************************************************************************************/
40
41inline std::string make_string(const char* a, const char* b, const char* c) {
42 std::string result;
43 result.reserve(std::strlen(a) + std::strlen(b) + std::strlen(b));
44 result += a;
45 result += b;
46 result += c;
47 return result;
48}
49
50/**************************************************************************************************/
51
53struct str_less_t {
54 bool operator()(const char* x, const char* y) const {
55 while (*x && *x == *y) {
56 ++x;
57 ++y;
58 }
59 return *x < *y;
60 }
61};
62
65 bool operator()(const char* x, const char* y) const {
66 while (*x && *x == *y) {
67 ++x;
68 ++y;
69 }
70 return *x == *y;
71 }
72};
73
74
75/**************************************************************************************************/
76
77} // namespace adobe
78
79/**************************************************************************************************/
80
81
82#endif
83
84/**************************************************************************************************/
std::string make_string(const char *a, const char *b)
Definition string.hpp:31
bool operator()(const char *x, const char *y) const
Definition string.hpp:65
bool operator()(const char *x, const char *y) const
Definition string.hpp:54