Skip to content

Libs/Utils/StringUtils.h

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::StringUtils
String utility functions.

Source code

```cpp

pragma once

include

include

namespace shapeworks {

class StringUtils { public: static std::string removeExtension(std::string const& filename); static std::string getPath(std::string const& filename); static std::string getFilename(std::string const& pathname); static std::string getBaseFilenameWithoutExtension(std::string const& pathname); static std::string toLower(std::string s); static bool hasSuffix(std::string const& filename, std::string const& suffix); static std::vector getFileNamesFromPaths(const std::vector& paths);

static std::string getLowerExtension(std::string const& filename);

// safely convert a const char to string, allowing for nullptr static std::string safeString(const char s) { return s == nullptr ? std::string() : s; }

static std::string replace_string(std::string str, const std::string& search, const std::string& replace);

static std::string join(const std::vector& strings, const std::string& delimiter); };

} // namespace shapeworks ```


Updated on 2026-03-31 at 16:02:11 +0000