mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add SaveEntries() and LoadEntries(). (#233)
These allow saving and loading non-persistent entries in the persistent file format.
This commit is contained in:
@@ -460,3 +460,17 @@ std::shared_ptr<Value> NetworkTable::GetValue(StringRef key) const {
|
||||
}
|
||||
|
||||
StringRef NetworkTable::GetPath() const { return m_path; }
|
||||
|
||||
const char* NetworkTable::SaveEntries(StringRef filename) const {
|
||||
llvm::SmallString<128> path(m_path);
|
||||
path += PATH_SEPARATOR_CHAR;
|
||||
return nt::SaveEntries(m_inst, filename, path);
|
||||
}
|
||||
|
||||
const char* NetworkTable::LoadEntries(
|
||||
StringRef filename,
|
||||
std::function<void(size_t line, const char* msg)> warn) {
|
||||
llvm::SmallString<128> path(m_path);
|
||||
path += PATH_SEPARATOR_CHAR;
|
||||
return nt::LoadEntries(m_inst, filename, path, warn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user