AWS SDK for C++  0.12.9
AWS SDK for C++
StringUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010-2015 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 
68  static Aws::String URLEncode(double unsafe);
69 
70 
74  static Aws::String URLDecode(const char* safe);
75 
76 
80  static Aws::Vector<Aws::String> Split(const Aws::String& toSplit, char splitOn);
81 
82 
86  static Aws::Vector<Aws::String> SplitOnLine(const Aws::String& toSplit);
87 
88 
92  static Aws::String LTrim(const char* source);
93 
94 
98  static Aws::String RTrim(const char* source);
99 
103  static Aws::String Trim(const char* source);
104 
105 
109  static long long ConvertToInt64(const char* source);
110 
111 
115  static long ConvertToInt32(const char* source);
116 
117 
121  static bool ConvertToBool(const char* source);
122 
123 
127  static double ConvertToDouble(const char* source);
128 
129 
130 #ifdef _WIN32
131 
134  static Aws::WString ToWString(const char* source);
135 
139  static Aws::String FromWString(const wchar_t* source);
140 #endif
141 
145  template< typename T >
146  static Aws::String to_string(T value)
147  {
149  os << value;
150  return os.str();
151  }
152 
153  };
154 
155 
156  } // namespace Utils
157 } // namespace Aws
158 
159 
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:146
#define AWS_CORE_API
Definition: Core_EXPORTS.h:30
JSON (JavaScript Object Notation).