Skip to content

Commit 07e138b

Browse files
committed
README.md types table
1 parent 94f667b commit 07e138b

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Output:
8585
> noice - 90000 - 160 - 20 - 9.99 - FFFFFF
8686
8787
Notice how each character within `"sLdcfx-"` string specifies different type for each column. It is very important to set this format right.
88-
We could set each solumn to be strings like "sssssss", however this would use more memory than it's really needed. If we wanted to store a large array of small numerical values (e.g. under 128), then using "c" specifier would be appropriate. See "How to specify value types" section for full list of available specifiers and their descriptions.
88+
We could set each solumn to be strings like "sssssss", however this would use more memory than it's really needed. If we wanted to store a large array of small numerical values (e.g. under 128), then using "c" specifier would be appropriate. See [Specifying value types](#specifying-value-types) section for full list of available specifiers and their descriptions.
8989
9090
**Is it necessary to supply the whole string at once?**
9191
No, it may be supplied in incomplete parts as shown in [this example](https://github.com/michalmonday/CSV-Parser-for-Arduino/blob/master/examples/supplying_csv_by_incomplete_parts/supplying_csv_by_incomplete_parts.ino).
@@ -203,16 +203,22 @@ CSV_Parser cp(csv_str, /*format*/ "sf"); // s = string, f = float
203203
Example above is specifying "s" (string) for the 1st column, and "f" (float) for the 2nd column.
204204

205205
Possible specifiers are:
206-
**s** - string (C-like string, not a "String" Arduino object, just a char pointer, terminated by 0)
207-
**f** - float
208-
**L** - int32_t (32-bit signed value, can't be used for values over 2147483647)
209-
**d** - int16_t (16-bit signed value, can't be used for values over 32767)
210-
**c** - char (8-bit signed value, can't be used for values over 127)
211-
**x** - hex (stored as int32_t)
212-
**-** (dash character) means that value is unused/not-parsed (this way memory won't be allocated for values from that column)
206+
| Specifier | Type | Description |
207+
| --- | --- | --- |
208+
| **s** | string (char\*) | C-like string, not a "String" Arduino object. |
209+
| **f** | float |
210+
| **L** | int32_t | 32-bit signed value, value range: -2,147,483,648 to 2,147,483,647. |
211+
| **d** | int16_t | 16-bit signed value, value range: -32,768 to 32,767. |
212+
| **c** | char | 8-bit signed value, value range: -128 to 127. |
213+
| **x** | int32_t | Expects hexadecimal string (will store "10" or "0x10" csv as 16). |
214+
| **-** | | Dash character means that value is unused/not-parsed, this way memory won't be allocated for values from that column. |
215+
| **uL** | uint32_t | 32-bit unsigned value, value range: 0 to 4,294,967,295. |
216+
| **ud** | uint16_t | 16-bit unsigned value, value range: 0 to 65,535. |
217+
| **uc** | uint8_t | 8-bit unsigned value, value range: 0 to 255. |
218+
| **ux** | uint32_t | Expects hexadecimal string (will store "10" or "0x10" csv as 16). |
213219

214220
#### How to store unsigned types
215-
By preceding the integer based specifiers ("L", "d", "c", "x") with "u".
221+
As shown in the table above, unsigned type specifiers are made by preceding the integer based specifiers ("L", "d", "c", "x") with "u".
216222

217223
Example:
218224
```cpp

0 commit comments

Comments
 (0)