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 safeString(const char * s)

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 safeString

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

Updated on 2022-07-23 at 16:40:07 -0600