xo-object2: + DString.from_str()
This commit is contained in:
parent
66e666cc65
commit
5f5469637a
2 changed files with 15 additions and 0 deletions
|
|
@ -78,6 +78,12 @@ namespace xo {
|
|||
static DString * from_view(obj<AAllocator> mm,
|
||||
std::string_view sv);
|
||||
|
||||
/** create string containing a copy @p str.
|
||||
* Use memory from allocator @p mm.
|
||||
**/
|
||||
static DString * from_str(obj<AAllocator> mm,
|
||||
const std::string & str);
|
||||
|
||||
/** create string containing a copy of @p sv.
|
||||
* Use memory from allocator @p mm via sub_alloc.
|
||||
* (load-bearing for StringTable)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,15 @@ namespace xo {
|
|||
return _from_view_aux(mm, sv, false /*!suballoc_flag*/);
|
||||
}
|
||||
|
||||
DString *
|
||||
DString::from_str(obj<AAllocator> mm,
|
||||
const std::string & str)
|
||||
{
|
||||
return _from_view_aux(mm,
|
||||
std::string_view(str),
|
||||
false /*!suballoc_flag*/);
|
||||
}
|
||||
|
||||
DString *
|
||||
DString::from_view_suballoc(obj<AAllocator> mm,
|
||||
std::string_view sv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue