mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use std::string for string-formatted values (#1360)
* Use `std::string` for string-formatted values * Make `formatString` and `formatNumber` be `const`
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
enum FormatState {
|
||||
FORMAT_SIGN, // expects '+' or ' ' (optional)
|
||||
@@ -35,8 +36,9 @@ public:
|
||||
|
||||
void useCharacter(int c);
|
||||
void finishCharacters();
|
||||
void printString(char *buf, size_t bufLen, char const *value);
|
||||
void printNumber(char *buf, size_t bufLen, uint32_t value);
|
||||
|
||||
std::string formatString(std::string const &value) const;
|
||||
std::string formatNumber(uint32_t value) const;
|
||||
};
|
||||
|
||||
#endif // RGBDS_FORMAT_SPEC_H
|
||||
|
||||
Reference in New Issue
Block a user