diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 8280b11642..fd1e40ccb6 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -232,7 +232,7 @@ },"33": { "doc": "Parsing options", "title": "Parsing options", - "content": "# Parsing options When setting options from the [CLI Options](/doc/user/OPTIONS.html), the [commands](/doc/user/COMMANDS.html) or using the [libf3d options string API](/doc/libf3d/OPTIONS.html#string-api), the values are parsed according to their type. If parsing fails, the value is not changed. The following types are supported: - bool: A boolean, true or false. - int: A signed integer. - double: A floating point number. - ratio: A double dividend over a double divisor, stored in a double. - string: A string of characters. As well as a list for each of these types, noted as - vector\\ ## Bool The following formats are supported when parsing a bool, case insensitive: - true/false - yes/no - on/off - 1/0 When formatting a bool into a string, true/false is used. ## Int Int parsing is supported using [std::stoi](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check that the whole string is parsed. When formatting an int into a string, [std::to_string](https://en.cppreference.com/w/cpp/string/basic_string/to_string) is used. ## Double Double parsing is supported using [std::stod](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check that the whole string is parsed. When formatting a double into a string, [std::ostringstream](https://en.cppreference.com/w/cpp/io/basic_ostringstream) is used with removing the point and precision when the value is exactly an integer. ## Ratio The following formats are supported when parsing a string into a ratio: - percent% where percent is a double - dividend/divisor where both are doubles - double Percent, dividend, divisor are then parsed as double. When formatting a ratio into a string, it is formatted as a double. ## String String are parsed and formatted as is. ## Vectors Vector tokens are separated by `,`, tokens are then parsed using their respective types. When formatting a vector into a string, individual token are formatted according to their type and separated using `,`. ", + "content": "# Parsing options When setting options from the [CLI Options](/doc/user/OPTIONS.html), the [commands](/doc/user/COMMANDS.html) or using the [libf3d options string API](/doc/libf3d/OPTIONS.html#string-api), the values are parsed according to their type. If parsing fails, the value is not changed. The following types are supported: - bool: A boolean, true or false. - int: A signed integer. - double: A floating point number. - ratio: A double dividend over a double divisor, stored in a double. - string: A string of characters. As well as a list for each of these types, noted as - vector\\ ## Bool The following formats are supported when parsing a bool, case insensitive: - true/false - yes/no - on/off - 1/0 When formatting a bool into a string, true/false is used. ## Int Int parsing is supported using [std::stoi](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check that the whole string is parsed. When formatting an int into a string, [std::to_string](https://en.cppreference.com/w/cpp/string/basic_string/to_string) is used. ## Double Double parsing is supported using [std::stod](https://en.cppreference.com/w/cpp/string/basic_string/stol) and check that the whole string is parsed. When formatting a double into a string, [std::ostringstream](https://en.cppreference.com/w/cpp/io/basic_ostringstream) is used with removing the point and precision when the value is exactly an integer. ## Ratio The following formats are supported when parsing a string into a ratio: - percent% where percent is a double - dividend:divisor where both are doubles - dividend/divisor where both are doubles - double Percent, dividend, divisor are then parsed as double. When formatting a ratio into a string, it is formatted as a double. ## String String are parsed and formatted as is. ## Vectors Vector tokens are separated by `,`, tokens are then parsed using their respective types. When formatting a vector into a string, individual token are formatted according to their type and separated using `,`. ", "url": "/doc/user/PARSING.html", "relUrl": "/doc/user/PARSING.html" diff --git a/doc/user/PARSING.html b/doc/user/PARSING.html index a4c9f85507..014ecf2a7e 100644 --- a/doc/user/PARSING.html +++ b/doc/user/PARSING.html @@ -1 +1 @@ - Parsing options | F3D Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Parsing options

When setting options from the CLI Options, the commands or using the libf3d options string API, the values are parsed according to their type. If parsing fails, the value is not changed.

The following types are supported:

  • bool: A boolean, true or false.
  • int: A signed integer.
  • double: A floating point number.
  • ratio: A double dividend over a double divisor, stored in a double.
  • string: A string of characters.

As well as a list for each of these types, noted as

  • vector<type>

Bool

The following formats are supported when parsing a bool, case insensitive:

  • true/false
  • yes/no
  • on/off
  • 1/0

When formatting a bool into a string, true/false is used.

Int

Int parsing is supported using std::stoi and check that the whole string is parsed.

When formatting an int into a string, std::to_string is used.

Double

Double parsing is supported using std::stod and check that the whole string is parsed.

When formatting a double into a string, std::ostringstream is used with removing the point and precision when the value is exactly an integer.

Ratio

The following formats are supported when parsing a string into a ratio:

  • percent% where percent is a double
  • dividend/divisor where both are doubles
  • double

Percent, dividend, divisor are then parsed as double.

When formatting a ratio into a string, it is formatted as a double.

String

String are parsed and formatted as is.

Vectors

Vector tokens are separated by ,, tokens are then parsed using their respective types.

When formatting a vector into a string, individual token are formatted according to their type and separated using ,.

+ Parsing options | F3D Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Parsing options

When setting options from the CLI Options, the commands or using the libf3d options string API, the values are parsed according to their type. If parsing fails, the value is not changed.

The following types are supported:

  • bool: A boolean, true or false.
  • int: A signed integer.
  • double: A floating point number.
  • ratio: A double dividend over a double divisor, stored in a double.
  • string: A string of characters.

As well as a list for each of these types, noted as

  • vector<type>

Bool

The following formats are supported when parsing a bool, case insensitive:

  • true/false
  • yes/no
  • on/off
  • 1/0

When formatting a bool into a string, true/false is used.

Int

Int parsing is supported using std::stoi and check that the whole string is parsed.

When formatting an int into a string, std::to_string is used.

Double

Double parsing is supported using std::stod and check that the whole string is parsed.

When formatting a double into a string, std::ostringstream is used with removing the point and precision when the value is exactly an integer.

Ratio

The following formats are supported when parsing a string into a ratio:

  • percent% where percent is a double
  • dividend:divisor where both are doubles
  • dividend/divisor where both are doubles
  • double

Percent, dividend, divisor are then parsed as double.

When formatting a ratio into a string, it is formatted as a double.

String

String are parsed and formatted as is.

Vectors

Vector tokens are separated by ,, tokens are then parsed using their respective types.

When formatting a vector into a string, individual token are formatted according to their type and separated using ,.

diff --git a/doc/user/PARSING.md b/doc/user/PARSING.md index 66649df57f..1471c80102 100644 --- a/doc/user/PARSING.md +++ b/doc/user/PARSING.md @@ -41,6 +41,7 @@ with removing the point and precision when the value is exactly an integer. The following formats are supported when parsing a string into a ratio: - percent% where percent is a double + - dividend:divisor where both are doubles - dividend/divisor where both are doubles - double diff --git a/web/f3d.wasm b/web/f3d.wasm index f6bee9f940..1817a1144c 100644 Binary files a/web/f3d.wasm and b/web/f3d.wasm differ