neutrino: sync keybind and usermenu code with neutrino-mp, code (C) martii

Origin commit data
------------------
Branch: ni/coolstream
Commit: 420af7a4dc
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-09-05 (Fri, 05 Sep 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2014-09-05 17:49:11 +04:00
parent 4c9da61afa
commit 4eb5179286
45 changed files with 1767 additions and 1144 deletions

View File

@@ -84,20 +84,22 @@ class CFileHelpers
bool removeDir(const char *Dir);
};
template<class C> std::string to_string(C i)
{
std::stringstream s;
s << i;
return s.str();
}
inline void cstrncpy(char *dest, const char * const src, size_t n) { n--; strncpy(dest, src, n); dest[n] = 0; }
inline void cstrncpy(char *dest, const std::string &src, size_t n) { n--; strncpy(dest, src.c_str(), n); dest[n] = 0; }
bool split_config_string(const std::string &str, std::map<std::string,std::string> &smap);
std::string to_string(int);
std::string to_string(unsigned int);
std::string to_string(long);
std::string to_string(unsigned long);
std::string to_string(long long);
std::string to_string(unsigned long long);
inline int atoi(std::string &s) { return atoi(s.c_str()); }
inline int atoi(const std::string &s) { return atoi(s.c_str()); }
inline int access(std::string &s, int mode) { return access(s.c_str(), mode); }
inline int access(const std::string &s, int mode) { return access(s.c_str(), mode); }
inline void cstrncpy(char *dest, const char * const src, size_t n) { n--; strncpy(dest, src, n); dest[n] = 0; }
inline void cstrncpy(char *dest, const std::string &src, size_t n) { n--; strncpy(dest, src.c_str(), n); dest[n] = 0; }
std::vector<std::string> split(const std::string &s, char delim);
bool split_config_string(const std::string &str, std::map<std::string,std::string> &smap);
#endif