ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
text_traits.h
Go to the documentation of this file.
1#pragma once
2
3#include <utility>
4
7
8namespace esphome {
9namespace text {
10
11enum TextMode : uint8_t {
14};
15
17 public:
18 // Set/get the number value boundaries.
19 void set_min_length(int min_length) { this->min_length_ = min_length; }
20 int get_min_length() const { return this->min_length_; }
21 void set_max_length(int max_length) { this->max_length_ = max_length; }
22 int get_max_length() const { return this->max_length_; }
23
24 // Set/get the pattern.
25 void set_pattern(std::string pattern) { this->pattern_ = std::move(pattern); }
26 std::string get_pattern() const { return this->pattern_; }
27 StringRef get_pattern_ref() const { return StringRef(this->pattern_); }
28
29 // Set/get the frontend mode.
30 void set_mode(TextMode mode) { this->mode_ = mode; }
31 TextMode get_mode() const { return this->mode_; }
32
33 protected:
36 std::string pattern_;
38};
39
40} // namespace text
41} // namespace esphome
BedjetMode mode
BedJet operating mode.
StringRef is a reference to a string owned by something else.
Definition string_ref.h:22
void set_mode(TextMode mode)
Definition text_traits.h:30
TextMode get_mode() const
Definition text_traits.h:31
void set_pattern(std::string pattern)
Definition text_traits.h:25
StringRef get_pattern_ref() const
Definition text_traits.h:27
void set_max_length(int max_length)
Definition text_traits.h:21
std::string get_pattern() const
Definition text_traits.h:26
void set_min_length(int min_length)
Definition text_traits.h:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7