MCPcopy Create free account
hub / github.com/TankOs/SFGUI / BuildString

Method BuildString

src/SFGUI/Selector.cpp:112–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112std::string Selector::BuildString() const {
113 std::string str;
114
115 // Build parent's string first.
116 if( m_parent ) {
117 str += m_parent->BuildString();
118
119 switch( m_hierarchy_type ) {
120 case HierarchyType::CHILD: {
121 str += ">";
122 } break;
123 case HierarchyType::DESCENDANT: {
124 str += " ";
125 } break;
126 default: break;
127 }
128 }
129
130 // Append own string.
131 if( m_widget.empty() ) {
132 // Use a wildcard for all widgets.
133 str += "*";
134 }
135 else {
136 str += m_widget;
137 }
138
139 if( !m_id.empty() ) {
140 str += "#";
141 str += m_id;
142 }
143
144 if( !m_class.empty() ) {
145 str += ".";
146 str += m_class;
147 }
148
149 if( m_state ) {
150 str += ":";
151
152 switch( *m_state ) {
153 case Widget::State::NORMAL:
154 str += "NORMAL";
155 break;
156 case Widget::State::PRELIGHT:
157 str += "PRELIGHT";
158 break;
159 case Widget::State::ACTIVE:
160 str += "ACTIVE";
161 break;
162 case Widget::State::SELECTED:
163 str += "SELECTED";
164 break;
165 case Widget::State::INSENSITIVE:
166 str += "INSENSITIVE";
167 break;
168
169 default:

Callers 1

CreateMethod · 0.80

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected