World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Strings.h
См. документацию.
1 #pragma once
2 
3 #include <string>
4 #include <functional>
5 #include <cstring>
6 #ifndef _WINDOWS
7 #include "Common/PlatformLinux.h"
8 #endif
9 
11 
12 String StringPrintf(const char *fmt, ...);
14 String MakeLower(const String &text);
15 
16 //----- (00452C30) --------------------------------------------------------
17 inline char *RemoveQuotes(char *str) {
18  if (*str == '"') {
19  str[strlen(str) - 1] = 0;
20  return str + 1;
21  }
22  return str;
23 }
24 
25 struct ci_less : std::binary_function<std::string, std::string,
26  bool> { // case insensitive comparator for
27  // dictionaries
28  // case-independent (ci) compare_less binary function
30  : public std::binary_function<unsigned char, unsigned char, bool> {
31  bool operator()(const unsigned char &c1,
32  const unsigned char &c2) const {
33  return tolower(c1) < tolower(c2);
34  }
35  };
36  bool operator()(const std::string &s1, const std::string &s2) const {
37  return std::lexicographical_compare(s1.begin(),
38  s1.end(), // source range
39  s2.begin(), s2.end(), // dest range
40  nocase_compare()); // comparison
41  }
42 };
RemoveQuotes
char * RemoveQuotes(char *str)
Definition: Strings.h:17
ci_less::operator()
bool operator()(const std::string &s1, const std::string &s2) const
Definition: Strings.h:36
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
ci_less::nocase_compare
Definition: Strings.h:29
s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: SDL_opengl_glext.h:8586
MakeLower
String MakeLower(const String &text)
Definition: Strings.cpp:43
value
EGLSyncKHR EGLint EGLint * value
Definition: SDL_egl.h:899
StringFromInt
String StringFromInt(int value)
Definition: Strings.cpp:7
ci_less::nocase_compare::operator()
bool operator()(const unsigned char &c1, const unsigned char &c2) const
Definition: Strings.h:31
PlatformLinux.h
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
ci_less
Definition: Strings.h:25
String
std::string String
Definition: Strings.h:10