mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Consistently name property max/min functions and add step/default.
This commit is contained in:
@@ -90,6 +90,8 @@ class SourceImpl {
|
||||
virtual void SetDoubleProperty(int property, double value) = 0;
|
||||
virtual double GetPropertyMin(int property) const = 0;
|
||||
virtual double GetPropertyMax(int property) const = 0;
|
||||
virtual double GetPropertyStep(int property) const = 0;
|
||||
virtual double GetPropertyDefault(int property) const = 0;
|
||||
virtual llvm::StringRef GetStringProperty(
|
||||
int property, llvm::SmallVectorImpl<char>& buf) const = 0;
|
||||
virtual void SetStringProperty(int property, llvm::StringRef value) = 0;
|
||||
|
||||
@@ -56,12 +56,20 @@ void CS_SetDoubleProperty(CS_Property property, double value,
|
||||
return cs::SetDoubleProperty(property, value, status);
|
||||
}
|
||||
|
||||
double CS_GetDoublePropertyMin(CS_Property property, CS_Status* status) {
|
||||
return cs::GetDoublePropertyMin(property, status);
|
||||
double CS_GetPropertyMin(CS_Property property, CS_Status* status) {
|
||||
return cs::GetPropertyMin(property, status);
|
||||
}
|
||||
|
||||
double CS_GetDoublePropertyMax(CS_Property property, CS_Status* status) {
|
||||
return cs::GetDoublePropertyMax(property, status);
|
||||
double CS_GetPropertyMax(CS_Property property, CS_Status* status) {
|
||||
return cs::GetPropertyMax(property, status);
|
||||
}
|
||||
|
||||
double CS_GetPropertyStep(CS_Property property, CS_Status* status) {
|
||||
return cs::GetPropertyStep(property, status);
|
||||
}
|
||||
|
||||
double CS_GetPropertyDefault(CS_Property property, CS_Status* status) {
|
||||
return cs::GetPropertyDefault(property, status);
|
||||
}
|
||||
|
||||
char* CS_GetStringProperty(CS_Property property, CS_Status* status) {
|
||||
|
||||
@@ -92,20 +92,34 @@ void SetDoubleProperty(CS_Property property, double value, CS_Status* status) {
|
||||
source->SetDoubleProperty(propertyIndex, value);
|
||||
}
|
||||
|
||||
double GetDoublePropertyMin(CS_Property property, CS_Status* status) {
|
||||
double GetPropertyMin(CS_Property property, CS_Status* status) {
|
||||
int propertyIndex;
|
||||
auto source = GetPropertySource(property, &propertyIndex, status);
|
||||
if (!source) return 0.0;
|
||||
return source->GetPropertyMin(propertyIndex);
|
||||
}
|
||||
|
||||
double GetDoublePropertyMax(CS_Property property, CS_Status* status) {
|
||||
double GetPropertyMax(CS_Property property, CS_Status* status) {
|
||||
int propertyIndex;
|
||||
auto source = GetPropertySource(property, &propertyIndex, status);
|
||||
if (!source) return 0.0;
|
||||
return source->GetPropertyMax(propertyIndex);
|
||||
}
|
||||
|
||||
double GetPropertyStep(CS_Property property, CS_Status* status) {
|
||||
int propertyIndex;
|
||||
auto source = GetPropertySource(property, &propertyIndex, status);
|
||||
if (!source) return 0.0;
|
||||
return source->GetPropertyStep(propertyIndex);
|
||||
}
|
||||
|
||||
double GetPropertyDefault(CS_Property property, CS_Status* status) {
|
||||
int propertyIndex;
|
||||
auto source = GetPropertySource(property, &propertyIndex, status);
|
||||
if (!source) return 0.0;
|
||||
return source->GetPropertyDefault(propertyIndex);
|
||||
}
|
||||
|
||||
std::string GetStringProperty(CS_Property property, CS_Status* status) {
|
||||
llvm::SmallString<128> value;
|
||||
int propertyIndex;
|
||||
|
||||
Reference in New Issue
Block a user