refactor(core): Clean-up

- use "#pragma once" instead of the regular include guard
- fix errors and warnings reported by cppcheck
This commit is contained in:
Michael Carlberg
2016-05-31 05:58:58 +02:00
parent d0499d4d15
commit 39d3f61497
81 changed files with 588 additions and 730 deletions

View File

@ -1,17 +1,13 @@
#ifndef _UTILS_STRING_HPP_
#define _UTILS_STRING_HPP_
#pragma once
#include <string>
#include <vector>
#define STR(s) std::string(s)
#define STRI(s) std::to_string(s)
namespace string
{
bool compare(const std::string& s1, const std::string& s2);
std::string upper(const std::string& s);
// std::string upper(const std::string& s);
std::string lower(const std::string& s);
std::string replace(const std::string& haystack, const std::string& needle, const std::string& replacement);
@ -19,7 +15,7 @@ namespace string
std::string squeeze(const std::string& haystack, const char &needle);
std::string strip(const std::string& haystack, const char &needle);
// std::string strip(const std::string& haystack, const char &needle);
std::string strip_trailing_newline(const std::string& s);
std::string trim(const std::string& haystack, const char &needle);
@ -33,5 +29,3 @@ namespace string
std::size_t find_nth(const std::string& haystack, std::size_t pos, const std::string& needle, std::size_t nth);
}
#endif