AWS SDK for C++  0.14.3
AWS SDK for C++
StringUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 
17 #pragma once
18 
19 
20 #include <aws/core/Core_EXPORTS.h>
21 
22 
26 
27 
28 
29 namespace Aws
30 {
31  namespace Utils
32  {
37  {
38  public:
39  static void Replace(Aws::String& s, const char* search, const char* replace);
40 
41 
45  static Aws::String ToLower(const char* source);
46 
47 
51  static Aws::String ToUpper(const char* source);
52 
53 
57  static bool CaselessCompare(const char* value1, const char* value2);
58 
59 
63  static Aws::String URLEncode(const char* unsafe);
64 
70  static Aws::String UTF8Escape(const char* unicodeString, const char* delimiter);
71 
75  static Aws::String URLEncode(double unsafe);
76 
77 
81  static Aws::String URLDecode(const char* safe);
82 
83 
87  static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn);
88 
89 
93  static Aws::Vector<Aws::String> SplitOnLine(const Aws::String& toSplit);
94 
95 
99  static Aws::String LTrim(const char* source);
100 
101 
105  static Aws::String RTrim(const char* source);
106 
110  static Aws::String Trim(const char* source);
111 
112 
116  static long long ConvertToInt64(const char* source);
117 
118 
122  static long ConvertToInt32(const char* source);
123 
124 
128  static bool ConvertToBool(const char* source);
129 
130 
134  static double ConvertToDouble(const char* source);
135 
136 
137 #ifdef _WIN32
138 
141  static Aws::WString ToWString(const char* source);
142 
146  static Aws::String FromWString(const wchar_t* source);
147 #endif
148 
152  template< typename T >
153  static Aws::String to_string(T value)
154  {
156  os << value;
157  return os.str();
158  }
159 
160  };
161 
162 
163  } // namespace Utils
164 } // namespace Aws
165 
166 
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
std::basic_ostringstream< char, std::char_traits< char >, Aws::Allocator< char > > OStringStream
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
static Aws::String to_string(T value)
Definition: StringUtils.h:153
#define AWS_CORE_API
Definition: Core_EXPORTS.h:35
JSON (JavaScript Object Notation).