Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strutil: add new utilities for parsing values out of strings #3173

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Nov 7, 2021

  • parse_values() and scan_values() both can parse a series of
    values in a string, with optional prefix, suffix, and separator. The
    scan versions just figure out the values, the parse versions
    optionally can update a string_view& like the other parsing
    functions in Strutil.

  • scan_datetime parses the int components of a string that looks like
    "YYYY:MM:DD hh:mm:ss" (and a few minor variants).

  • Fix stoui -- it was previously casting stoi results, which is not
    correct.

  • Add from_string<> specialties for double, int64_t, uint64_t.

* `parse_values()` and `scan_values()` both can parse a series of
  values in a string, with optional prefix, suffix, and separator. The
  scan versions just figure out the values, the parse versions
  optionally can update a string_view& like the other parsing
  functions in Strutil.

* `scan_datetime` parses the int components of a string that looks like
  "YYYY:MM:DD hh:mm:ss" (and a few minor variants).

* Fix stoui -- it was previously casting stoi results, which is not
  correct.

* Add `from_string<>` specialties for `double`, `int64_t`, `uint64_t`.
@lgritz lgritz merged commit 974f79b into AcademySoftwareFoundation:master Nov 10, 2021
@lgritz lgritz deleted the lg-strutil branch November 10, 2021 22:43
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 21, 2021
…SoftwareFoundation#3173)

* `parse_values()` and `scan_values()` both can parse a series of
  values in a string, with optional prefix, suffix, and separator. The
  scan versions just figure out the values, the parse versions
  optionally can update a string_view& like the other parsing
  functions in Strutil.

* `scan_datetime` parses the int components of a string that looks like
  "YYYY:MM:DD hh:mm:ss" (and a few minor variants).

* Fix stoui -- it was previously casting stoi results, which is not
  correct.

* Add `from_string<>` specialties for `double`, `int64_t`, `uint64_t`.
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Nov 22, 2021
…SoftwareFoundation#3173)

* `parse_values()` and `scan_values()` both can parse a series of
  values in a string, with optional prefix, suffix, and separator. The
  scan versions just figure out the values, the parse versions
  optionally can update a string_view& like the other parsing
  functions in Strutil.

* `scan_datetime` parses the int components of a string that looks like
  "YYYY:MM:DD hh:mm:ss" (and a few minor variants).

* Fix stoui -- it was previously casting stoi results, which is not
  correct.

* Add `from_string<>` specialties for `double`, `int64_t`, `uint64_t`.
lgritz added a commit that referenced this pull request Nov 29, 2021
* `parse_values()` and `scan_values()` both can parse a series of
  values in a string, with optional prefix, suffix, and separator. The
  scan versions just figure out the values, the parse versions
  optionally can update a string_view& like the other parsing
  functions in Strutil.

* `scan_datetime` parses the int components of a string that looks like
  "YYYY:MM:DD hh:mm:ss" (and a few minor variants).

* Fix stoui -- it was previously casting stoi results, which is not
  correct.

* Add `from_string<>` specialties for `double`, `int64_t`, `uint64_t`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant