mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Make StringValue noncopyable.
Change-Id: I5b02cf988aaa15c467fa62c96c951d2891bc43db
This commit is contained in:
@@ -140,7 +140,7 @@ void Storage::SavePersistent(std::ostream& os) const {
|
|||||||
}
|
}
|
||||||
case NT_STRING_ARRAY: {
|
case NT_STRING_ARRAY: {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (auto elem : v.GetStringArray()) {
|
for (auto& elem : v.GetStringArray()) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
os << ',';
|
os << ',';
|
||||||
first = false;
|
first = false;
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ namespace ntimpl {
|
|||||||
class Storage;
|
class Storage;
|
||||||
class Value;
|
class Value;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C++ wrapper class around NT_String.
|
||||||
|
*/
|
||||||
class StringValue : private NT_String {
|
class StringValue : private NT_String {
|
||||||
friend class Value;
|
friend class Value;
|
||||||
public:
|
public:
|
||||||
@@ -27,8 +30,14 @@ class StringValue : private NT_String {
|
|||||||
~StringValue() { NT_DisposeString(this); }
|
~StringValue() { NT_DisposeString(this); }
|
||||||
|
|
||||||
operator llvm::StringRef() const { return llvm::StringRef(str, len); }
|
operator llvm::StringRef() const { return llvm::StringRef(str, len); }
|
||||||
|
|
||||||
|
StringValue(const StringValue&) = delete;
|
||||||
|
StringValue& operator=(const StringValue&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C++ wrapper class around NT_Value.
|
||||||
|
*/
|
||||||
class Value : private NT_Value {
|
class Value : private NT_Value {
|
||||||
friend class Storage;
|
friend class Storage;
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user