Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/importer/obj_import_string_utils.hh
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| const char *parse_int( | const char *parse_int( | ||||
| const char *p, const char *end, int fallback, int &dst, bool skip_space = true); | const char *p, const char *end, int fallback, int &dst, bool skip_space = true); | ||||
| /** | /** | ||||
| * Parse a float from an input string. | * Parse a float from an input string. | ||||
| * The parsed result is stored in `dst`. The function skips | * The parsed result is stored in `dst`. The function skips | ||||
| * leading white-space unless `skip_space=false`. If the | * leading white-space unless `skip_space=false`. If the | ||||
| * number can't be parsed (invalid syntax, out of range), | * number can't be parsed (invalid syntax, out of range), | ||||
| * `fallback` value is stored instead. | * `fallback` value is stored instead. If `require_trailing_space` | ||||
| * is true, the character after the number has to be whitespace. | |||||
| * | * | ||||
| * Returns the start of remainder of the input string after parsing. | * Returns the start of remainder of the input string after parsing. | ||||
| */ | */ | ||||
| const char *parse_float( | const char *parse_float(const char *p, | ||||
| const char *p, const char *end, float fallback, float &dst, bool skip_space = true); | const char *end, | ||||
| float fallback, | |||||
| float &dst, | |||||
| bool skip_space = true, | |||||
| bool require_trailing_space = false); | |||||
| /** | /** | ||||
| * Parse a number of white-space separated floats from an input string. | * Parse a number of white-space separated floats from an input string. | ||||
| * The parsed `count` numbers are stored in `dst`. If a | * The parsed `count` numbers are stored in `dst`. If a | ||||
| * number can't be parsed (invalid syntax, out of range), | * number can't be parsed (invalid syntax, out of range), | ||||
| * `fallback` value is stored instead. | * `fallback` value is stored instead. | ||||
| * | * | ||||
| * Returns the start of remainder of the input string after parsing. | * Returns the start of remainder of the input string after parsing. | ||||
| */ | */ | ||||
| const char *parse_floats(const char *p, const char *end, float fallback, float *dst, int count); | const char *parse_floats(const char *p, | ||||
| const char *end, | |||||
| float fallback, | |||||
| float *dst, | |||||
| int count, | |||||
| bool require_trailing_space = false); | |||||
| } // namespace blender::io::obj | } // namespace blender::io::obj | ||||