-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathStringUtil.h
More file actions
58 lines (48 loc) · 1.56 KB
/
Copy pathStringUtil.h
File metadata and controls
58 lines (48 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright 2017 Sony Corporation
*/
#ifndef EASYHTTPCPP_COMMON_STRINGUTIL_H_INCLUDED
#define EASYHTTPCPP_COMMON_STRINGUTIL_H_INCLUDED
#include <string>
#include "easyhttpcpp/common/CommonExports.h"
namespace easyhttpcpp {
namespace common {
class EASYHTTPCPP_COMMON_API StringUtil {
public:
/**
* @brief format is string formatter.
* %c char
* %s char *
* %d int, short
* %u unsigned int, unsigned short
* %o int, short, unsigned int, unsigned short
* %x int, short, unsigned int, unsigned short
* %f float
* %e float
* %g float
* %ld long
* %lu unsigned long
* %lo long, unsigned long
* %lx long, unsigned long
* %lf double
* %lld long long
* %llu unsigned long long
*
* @param pFormat
* @param ...
* @return the formatted string.
*/
static std::string format(const char* pFormat, ...);
static const char* boolToString(bool boolean);
static bool endsWith(const std::string& str, const std::string& end);
static bool startsWith(const std::string& str, const std::string& start);
static bool isNullOrEmpty(const std::string* str);
static std::string formatVersion(const std::string& major, const std::string& minor,
const std::string& patch, const std::string& extension);
private:
StringUtil();
virtual ~StringUtil();
};
} /* namespace common */
} /* namespace easyhttpcpp */
#endif /* EASYHTTPCPP_COMMON_STRINGUTIL_H_INCLUDED */