It's definitely possible. How you do it depends on what input you expect. For example, if you know you're about to read a checkbox string, then create an operator>>()
for the checkbox class.
std::istream& operator>>(std::istream& in, CheckBox& cb)
{
std::string input_str;
in >> input_str;
if( str == "CheckBox::unchecked" ) cb.set_value(false);
else if( str == "CheckBox::checked" ) cb.set_value(true);
else in.setstate(ios::badbit);
return in;
}
// ...
CheckBox b;
if( !( cin >> b) )
// ...
If you don't know what you're about to read then you're in the grammar and parsing domain. For that, you must define your grammar (when is the "checkbox" string allowed?). Once you have the grammar written down you write a lexer and a parser. There are tools for that.