Merge branch 'master' of https://libneat.hopto.org/git/kevin/KDE
This commit is contained in:
commit
ff2298a216
|
@ -84,6 +84,20 @@ void StringRepository::releaseString(StringHandle)
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
StringHandle StringRepository::concatenateString(StringHandle a, StringHandle b)
|
||||||
|
{
|
||||||
|
ZoneScoped;
|
||||||
|
const char* texta = getString(a);
|
||||||
|
const char* textb = getString(b);
|
||||||
|
size_t length = strlen(texta) + strlen(textb);
|
||||||
|
char* textc = (char*)malloc(sizeof(char)*(length+1));
|
||||||
|
snprintf(textc, length + 1, "%s%s", texta, textb);
|
||||||
|
nt_string_handle c = internString(textc);
|
||||||
|
free(textc);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
void StringRepository::freeAll()
|
void StringRepository::freeAll()
|
||||||
{
|
{
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
|
|
|
@ -41,6 +41,11 @@ public:
|
||||||
/// @brief Frees a string
|
/// @brief Frees a string
|
||||||
void releaseString(StringHandle handle);
|
void releaseString(StringHandle handle);
|
||||||
|
|
||||||
|
/// @brief Adds a string to the string repository
|
||||||
|
/// @param a the first string
|
||||||
|
/// @param b the second string
|
||||||
|
StringHandle concatenateString(StringHandle a, StringHandle b);
|
||||||
|
|
||||||
/// @brief Frees all strings inside the repository
|
/// @brief Frees all strings inside the repository
|
||||||
void freeAll();
|
void freeAll();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user