27 std::string::size_type eq_pos = opt.find_first_of(
"=");
28 if (eq_pos == std::string::npos) {
34 while (name.size() && name[0] ==
' ')
36 while (name.size() && name[name.size() - 1] ==
' ')
37 name.erase(name.size() - 1);
41 char v = value.size() ? value[0] :
' ';
42 if ((v >=
'0' && v <=
'9') || v ==
'+' || v ==
'-') {
43 if (strchr(value.c_str(),
'.'))
51 if (value.size() >= 2 && (value[0] ==
'\"' || value[0] ==
'\'')
52 && value[value.size() - 1] == value[0])
55 return system.attribute(name, value);
71 size_t len = optstring.length();
77 unsigned char c = optstring[pos];
83 }
else if (c ==
'\"' || c ==
'\'') {
88 }
else if (c ==
',' && !inquote) {
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
String-related utilities, all in namespace Strutil.
OIIO_UTIL_API float stof(string_view s, size_t *pos=0)
OIIO_NAMESPACE_BEGIN bool optparse1(C &system, const std::string &opt)
OIIO_UTIL_API int stoi(string_view s, size_t *pos=0, int base=10)
GLuint const GLchar * name
#define OIIO_NAMESPACE_END
bool optparser(C &system, const std::string &optstring)
#define OIIO_NAMESPACE_BEGIN