🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
StringPosix.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include <string>
25#include <cstring>
26#include <cctype> // for std::isspace
27
28AST_NAMESPACE_BEGIN
29
30typedef std::string String;
31
32
33namespace posix{
34
35#ifdef _WIN32
40A_ALWAYS_INLINE int strcasecmp(const char* str1, const char* str2)
41{
42 return ::_stricmp(str1, str2);
43}
44
50A_ALWAYS_INLINE int strncasecmp(const char* str1, const char* str2, size_t n)
51{
52 return ::_strnicmp(str1, str2, n);
53}
54
55#else
56using ::strcasecmp;
57using ::strncasecmp;
58#endif
59
60}
61
62// 比较两个字符串是否相等(不区分大小写)
63#ifdef _WIN32
64using ::stricmp;
65using ::strnicmp;
66#else
67
72A_ALWAYS_INLINE int stricmp(const char* str1, const char* str2)
73{
74 return ::strcasecmp(str1, str2);
75}
76
82A_ALWAYS_INLINE int strnicmp(const char* str1, const char* str2, size_t n)
83{
84 return ::strncasecmp(str1, str2, n);
85}
86
87#endif
88
89using posix::strcasecmp;
90using posix::strncasecmp;
91
92AST_NAMESPACE_END
A_ALWAYS_INLINE int stricmp(const char *str1, const char *str2)
比较两个字符串是否相等(不区分大小写)
定义 StringPosix.hpp:72
A_ALWAYS_INLINE int strnicmp(const char *str1, const char *str2, size_t n)
比较两个字符串是否相等(不区分大小写)
定义 StringPosix.hpp:82