mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcoreffi] Switch ntcoreffi DLM to WPI_String (#7359)
We forgot to do this originally.
This commit is contained in:
@@ -119,6 +119,7 @@ task cppHeadersZip(type: Zip) {
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn cppHeadersZip
|
||||
addTaskToCopyAllOutputs(cppHeadersZip)
|
||||
|
||||
model {
|
||||
|
||||
@@ -551,24 +551,28 @@ void DataLogManager::SignalNewDSDataOccur() {
|
||||
|
||||
extern "C" {
|
||||
|
||||
void DLM_Start(const char* dir, const char* filename, double period) {
|
||||
DataLogManager::Start(dir, filename, period);
|
||||
void DLM_Start(const struct WPI_String* dir, const struct WPI_String* filename,
|
||||
double period) {
|
||||
DataLogManager::Start(wpi::to_string_view(dir), wpi::to_string_view(filename),
|
||||
period);
|
||||
}
|
||||
|
||||
void DLM_Stop(void) {
|
||||
DataLogManager::Stop();
|
||||
}
|
||||
|
||||
void DLM_Log(const char* message) {
|
||||
DataLogManager::Log(message);
|
||||
void DLM_Log(const struct WPI_String* message) {
|
||||
DataLogManager::Log(wpi::to_string_view(message));
|
||||
}
|
||||
|
||||
WPI_DataLog* DLM_GetLog(void) {
|
||||
return reinterpret_cast<WPI_DataLog*>(&DataLogManager::GetLog());
|
||||
}
|
||||
|
||||
const char* DLM_GetLogDir(void) {
|
||||
return DataLogManager::GetLogDir().data();
|
||||
void DLM_GetLogDir(struct WPI_String* value) {
|
||||
auto logDir = DataLogManager::GetLogDir();
|
||||
char* write = WPI_AllocateString(value, logDir.size());
|
||||
std::memcpy(write, logDir.data(), logDir.size());
|
||||
}
|
||||
|
||||
void DLM_LogNetworkTables(int enabled) {
|
||||
|
||||
@@ -118,7 +118,7 @@ struct WPI_DataLog;
|
||||
* @param period time between automatic flushes to disk, in seconds;
|
||||
* this is a time/storage tradeoff
|
||||
*/
|
||||
void DLM_Start(const char* dir, const char* filename, double period);
|
||||
void DLM_Start(const struct WPI_String* dir, const struct WPI_String* filename, double period);
|
||||
|
||||
/**
|
||||
* Stop data log manager.
|
||||
@@ -131,7 +131,7 @@ void DLM_Stop(void);
|
||||
*
|
||||
* @param message message
|
||||
*/
|
||||
void DLM_Log(const char* message);
|
||||
void DLM_Log(const struct WPI_String* message);
|
||||
|
||||
/**
|
||||
* Get the managed data log (for custom logging). Starts the data log manager
|
||||
@@ -144,9 +144,9 @@ WPI_DataLog* DLM_GetLog(void);
|
||||
/**
|
||||
* Get the log directory.
|
||||
*
|
||||
* @return log directory
|
||||
* @param value returned value (output)
|
||||
*/
|
||||
const char* DLM_GetLogDir(void);
|
||||
void DLM_GetLogDir(struct WPI_String* value);
|
||||
|
||||
/**
|
||||
* Enable or disable logging of NetworkTables data. Note that unlike the
|
||||
|
||||
Reference in New Issue
Block a user