#include <CsvUtils.h>
|
static std::vector< std::string > | split (const std::string &csv) |
|
static std::vector< std::string > | splitProperSlug (const std::string &csv) |
|
static std::string | join (const std::vector< std::string > &parts) |
|
static std::string | join (const std::set< std::string > &parts) |
|
static std::string | prettyFrom (const std::vector< std::string > &ids, const std::string &beforeFinalItem) |
|
static std::string | from (const std::map< std::string, std::string > &properties) |
|
static std::string | toProperCsvAnd (const std::vector< std::string > &items) |
|
static std::string | toProperCsvOr (const std::vector< std::string > &items) |
|
static std::string | toProperCsv (std::vector< std::string > items, const std::string &finalSeparator) |
|
◆ from()
std::string CsvUtils::from |
( |
const std::map< std::string, std::string > & |
properties | ) |
|
|
static |
Get a CSV string of key=value properties
- Parameters
-
- Returns
- CSV string
◆ join() [1/2]
std::string CsvUtils::join |
( |
const std::set< std::string > & |
parts | ) |
|
|
static |
Join a set of items in alphabetical order
- Parameters
-
- Returns
◆ join() [2/2]
std::string CsvUtils::join |
( |
const std::vector< std::string > & |
parts | ) |
|
|
static |
Join a list of items
- Parameters
-
- Returns
◆ prettyFrom()
std::string CsvUtils::prettyFrom |
( |
const std::vector< std::string > & |
ids, |
|
|
const std::string & |
beforeFinalItem |
|
) |
| |
|
static |
Join a list of items properly, e.g. "One, Two, Three, and Four"
- Parameters
-
ids | to write |
beforeFinalItem | text after last comma |
- Returns
- CSV of ids
◆ split()
std::vector< std::string > CsvUtils::split |
( |
const std::string & |
csv | ) |
|
|
static |
Split a CSV string into a vector of strings
- Parameters
-
- Returns
- vector of strings
◆ splitProperSlug()
std::vector< std::string > CsvUtils::splitProperSlug |
( |
const std::string & |
csv | ) |
|
|
static |
Split a CSV string into a vector of proper slugs
- Parameters
-
- Returns
- vector of proper slugs
◆ toProperCsv()
std::string CsvUtils::toProperCsv |
( |
std::vector< std::string > |
items, |
|
|
const std::string & |
finalSeparator |
|
) |
| |
|
static |
Format a list of items as a proper CSV list, with the given final separator word
- Parameters
-
items | list of items |
finalSeparator | final separator word |
- Returns
- formatted list like "One, Two, ___ Three"
◆ toProperCsvAnd()
std::string CsvUtils::toProperCsvAnd |
( |
const std::vector< std::string > & |
items | ) |
|
|
static |
Format a list of items as a proper CSV list, with the given final separator word "and"
- Parameters
-
- Returns
- formatted list like "One, Two, and Three"
◆ toProperCsvOr()
std::string CsvUtils::toProperCsvOr |
( |
const std::vector< std::string > & |
items | ) |
|
|
static |
Format a list of items as a proper CSV list, with the given final separator word "or"
- Parameters
-
- Returns
- formatted list like "One, Two, or Three"
The documentation for this class was generated from the following files:
- /home/runner/work/xjmusic/xjmusic/engine/include/xjmusic/util/CsvUtils.h
- /home/runner/work/xjmusic/xjmusic/engine/src/util/CsvUtils.cpp