mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Reduces boost usage for strings
This commit is contained in:
parent
e8d9a8db67
commit
99bf50cd4e
5 changed files with 11 additions and 18 deletions
|
|
@ -35,7 +35,6 @@
|
|||
#include "ps/Filesystem.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
@ -93,7 +92,7 @@ public:
|
|||
Status ReloadChangedFile(const VfsPath& path)
|
||||
{
|
||||
// Ignore files that aren't in the right path
|
||||
if (!boost::algorithm::starts_with(path.string(), L"art/skeletons/"))
|
||||
if (!path.string().starts_with(L"art/skeletons/"))
|
||||
return INFO::OK;
|
||||
|
||||
if (path.Extension() != L".xml")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <exception>
|
||||
|
|
@ -518,7 +517,7 @@ VfsPath L10n::LocalizePath(const VfsPath& sourcePath) const
|
|||
|
||||
Status L10n::ReloadChangedFile(const VfsPath& path)
|
||||
{
|
||||
if (!boost::algorithm::starts_with(path.string(), L"l10n/"))
|
||||
if (!path.string().starts_with(L"l10n/"))
|
||||
return INFO::OK;
|
||||
|
||||
if (path.Extension() != L".po")
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#include "ps/XML/Xeromyces.h"
|
||||
#include "renderer/backend/dummy/Device.h"
|
||||
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <string>
|
||||
|
||||
CArchiveBuilder::CArchiveBuilder(const OsPath& mod, const OsPath& tempdir) :
|
||||
|
|
@ -98,13 +97,11 @@ void CArchiveBuilder::Build(const OsPath& archive, bool compress)
|
|||
ENSURE(ret == INFO::OK);
|
||||
|
||||
// Compress textures and store the new cached version instead of the original
|
||||
if ((boost::algorithm::starts_with(path.string(), L"art/textures/") ||
|
||||
boost::algorithm::starts_with(path.string(), L"fonts/")
|
||||
) &&
|
||||
if ((path.string().starts_with(L"art/textures/") || path.string().starts_with(L"fonts/")) &&
|
||||
tex_is_known_extension(path) &&
|
||||
// Skip some subdirectories where the engine doesn't use CTextureManager yet:
|
||||
!boost::algorithm::starts_with(path.string(), L"art/textures/cursors/") &&
|
||||
!boost::algorithm::starts_with(path.string(), L"art/textures/terrain/alphamaps/")
|
||||
!path.string().starts_with(L"art/textures/cursors/") &&
|
||||
!path.string().starts_with(L"art/textures/terrain/alphamaps/")
|
||||
)
|
||||
{
|
||||
VfsPath cachedPath;
|
||||
|
|
@ -128,9 +125,9 @@ void CArchiveBuilder::Build(const OsPath& archive, bool compress)
|
|||
{
|
||||
CColladaManager::FileType type;
|
||||
|
||||
if (boost::algorithm::starts_with(path.string(), L"art/meshes/"))
|
||||
if (path.string().starts_with(L"art/meshes/"))
|
||||
type = CColladaManager::PMD;
|
||||
else if (boost::algorithm::starts_with(path.string(), L"art/animation/"))
|
||||
else if (path.string().starts_with(L"art/animation/"))
|
||||
type = CColladaManager::PSA;
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include "ps/Profiler2.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <cstddef>
|
||||
#include <mutex>
|
||||
#include <unordered_set>
|
||||
|
|
@ -239,11 +238,11 @@ std::map<CStr, CConfigValueSet> CConfigDB::GetValuesWithPrefix(EConfigNamespace
|
|||
// values in earlier namespaces
|
||||
for (int search_ns = 0; search_ns <= ns; ++search_ns)
|
||||
for (const std::pair<const CStr, CConfigValueSet>& p : m_Map[search_ns])
|
||||
if (boost::algorithm::starts_with(p.first, prefix))
|
||||
if (p.first.starts_with(prefix))
|
||||
ret[p.first] = p.second;
|
||||
|
||||
for (const std::pair<const CStr, CConfigValueSet>& p : m_Map[CFG_COMMAND])
|
||||
if (boost::algorithm::starts_with(p.first, prefix))
|
||||
if (p.first.starts_with(prefix))
|
||||
ret[p.first] = p.second;
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
|
@ -826,9 +825,9 @@ bool ModIo::ParseSignature(const std::vector<std::string>& minisigs, SigStruct&
|
|||
// because that is easy.
|
||||
const std::string untrusted_comment_prefix = "untrusted comment: ";
|
||||
const std::string trusted_comment_prefix = "trusted comment: ";
|
||||
if (!boost::algorithm::starts_with(sig_lines[0], untrusted_comment_prefix))
|
||||
if (!sig_lines[0].starts_with(untrusted_comment_prefix))
|
||||
FAIL("Malformed untrusted comment.");
|
||||
if (!boost::algorithm::starts_with(sig_lines[2], trusted_comment_prefix))
|
||||
if (!sig_lines[2].starts_with(trusted_comment_prefix))
|
||||
FAIL("Malformed trusted comment.");
|
||||
|
||||
// We only _really_ care about the second line which is the signature of the file (b64-encoded)
|
||||
|
|
|
|||
Loading…
Reference in a new issue