Implemented app result and SelectionDialog (#96)

This commit is contained in:
Ken Van Hoeylandt
2024-11-27 21:13:07 +01:00
committed by GitHub
parent 4744565b0e
commit 6094b9c3f2
13 changed files with 345 additions and 12 deletions
+21
View File
@@ -1,6 +1,8 @@
#pragma once
#include <cstdio>
#include <string>
#include <vector>
namespace tt {
@@ -21,4 +23,23 @@ int string_find_last_index(const char* text, size_t from_index, char find);
*/
bool string_get_path_parent(const char* path, char* output);
/**
* Splits the provided input into separate pieces with delimiter as separator text.
* When the input string is empty, the output list will be empty too.
*
* @param input the input to split up
* @param delimiter a non-empty string to recognize as separator
*/
std::vector<std::string> string_split(const std::string& input, const std::string& delimiter);
/**
* Join a set of tokens into a single string, given a delimiter (separator).
* If the input is an empty list, the result will be an empty string.
* The delimeter is only placed inbetween tokens and not appended at the end of the resulting string.
*
* @param input the tokens to join together
* @param delimiter the separator to join with
*/
std::string string_join(const std::vector<std::string>& input, const std::string& delimiter);
} // namespace