Cogs.Core
StringViewCharPtr.cpp
1#include "StringViewCharPtr.h"
2
3namespace Cogs::Core
4{
6 {
7 if (data.length() == 0) {
8 view = copy;
9 }
10 else if (data[data.length()] == '\0') {
11 view = data;
12 }
13 else {
14 copy = data.to_string();
15 view = copy;
16 }
17 }
18}
StringViewCharPtr(const char *data)=delete
Construct from constant C-string. Always null terminated.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....