SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
truth_text.h
Go to the documentation of this file.
1#ifndef _truth_text_H_
2#define _truth_text_H_
3
4#include "transform.h"
5
6namespace sensesp {
7
24class TextToTruth : public Transform<String, bool> {
25 public:
26 virtual void set_input(String input, uint8_t input_channel = 0) override;
27
32 static bool is_valid_true(String value);
33
39 static bool is_valid_false(String value);
40};
41
48class TruthToText : public Transform<bool, String> {
49 public:
51
52 virtual void set_input(bool input, uint8_t input_channel = 0) override;
53
54 protected:
56};
57
58} // namespace sensesp
59#endif
Construct a new transform based on a single function.
Consumes a string and outputs boolean "true" if the text represents a human readable version of "true...
Definition truth_text.h:24
static bool is_valid_false(String value)
static bool is_valid_true(String value)
Definition truth_text.cpp:5
virtual void set_input(String input, uint8_t input_channel=0) override
The main Transform class. A transform is identified primarily by the type of value that is produces (...
Definition transform.h:54
Consumes a boolean value and outputs one the appropriate truth string specified in the constructor....
Definition truth_text.h:48
virtual void set_input(bool input, uint8_t input_channel=0) override