Skip to content

shapeworks::StringUtils

String utility functions.

#include <StringUtils.h>

Public Functions

Name
std::string removeExtension(std::string const & filename)
std::string getPath(std::string const & filename)
std::string getFilename(std::string const & pathname)
Remove path from filename and return.
std::string getBaseFilenameWithoutExtension(std::string const & pathname)
Get just the filename without path and without extension.
std::string toLower(std::string s)
bool hasSuffix(std::string const & filename, std::string const & suffix)
std::vector< std::string > getFileNamesFromPaths(const std::vector< std::string > & paths)
std::string getLowerExtension(std::string const & filename)
std::string safeString(const char * s)
std::string replace_string(std::string str, const std::string & search, const std::string & replace)
Replace a search string with a replacement.
std::string join(const std::vector< std::string > & strings, const std::string & delimiter)

Public Functions Documentation

function removeExtension

static std::string removeExtension(
    std::string const & filename
)

function getPath

static std::string getPath(
    std::string const & filename
)

function getFilename

static std::string getFilename(
    std::string const & pathname
)

Remove path from filename and return.

function getBaseFilenameWithoutExtension

static std::string getBaseFilenameWithoutExtension(
    std::string const & pathname
)

Get just the filename without path and without extension.

function toLower

static std::string toLower(
    std::string s
)

function hasSuffix

static bool hasSuffix(
    std::string const & filename,
    std::string const & suffix
)

function getFileNamesFromPaths

static std::vector< std::string > getFileNamesFromPaths(
    const std::vector< std::string > & paths
)

function getLowerExtension

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

function safeString

static inline std::string safeString(
    const char * s
)

function replace_string

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

Replace a search string with a replacement.

function join

static std::string join(
    const std::vector< std::string > & strings,
    const std::string & delimiter
)

Updated on 2024-11-11 at 19:51:46 +0000