Commit Graph

8 Commits

Author SHA1 Message Date
Wyatt Hepler
e2dc6d18d6 Safer snprintf / vsnprintf functions
Provide a string::Format function that writes to a span. The snprintf
return value is interpreted and returned as a StatusWithSize.

Change-Id: Ib7fed684dc333d5feaef85c1bb558cb45e3936bd
2019-11-15 21:54:48 +00:00
Wyatt Hepler
190feccb8c Hexadecimal printing function
Add IntToHexString, a simple hexadecimal output function.
PointerToString uses IntToHexString instead of IntToString.

Change-Id: Ib64ab888850d5050da84b4b84a2a279f0381f48f
2019-11-15 21:52:38 +00:00
Rob Mohr
e8fbe6a882 Add license metadata to bazel files.
Change-Id: Id32c7db700f3fba809d4e90473cbd3e8b8d7ca47
2019-11-15 11:52:14 -08:00
Keir Mierle
367493555e pw_string: Add missing string_view include
Change-Id: I0e6cdb68c48d9e8f21e64af719acf53e4e6495c6
2019-11-15 03:17:30 +00:00
Rob Mohr
cf185b4ccc Update bazel for pw_status and pw_string changes.
Change-Id: I698260e5dbb82625bb34e8a2c68a683eb569eddc
2019-11-14 18:29:39 +00:00
Wyatt Hepler
58823c1bea pw_string: ToString function
ToString allows writing string representations of arbitrary types to a
buffer.

Change-Id: Ie0e327560847509b03c651bd1697be8bc084b360
2019-11-14 17:58:56 +00:00
Rob Mohr
75e5fc9a15 Add pw_string to bazel build.
Change-Id: I0aa7741959b741de082d44afe87786754b572951
2019-11-14 09:16:03 -08:00
Wyatt Hepler
48db4d6f50 Start the pw_string module
Introduce functions for outputting numbers as strings. Unlike some
snprintf implementations, these functions support 64-bit integers. Also,
very limited floating point support is provided.

These functions are faster than snprintf and never truncate numbers.

Change-Id: Id5ae06a5d175f15403c34cddb2a077a88be47cf8
2019-11-14 16:32:39 +00:00