diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
commit | 6adef091b0713941e1149ecf21a5ab6feee3b06d (patch) | |
tree | 92011ccd85a65581c600f63d14c3eb38227cb68c /src | |
parent | 902611ac55dbd2c967f244b27c54d37540964c47 (diff) |
Introduce std::string overloads for prt() and c_prt()
Diffstat (limited to 'src')
-rw-r--r-- | src/util.cc | 14 | ||||
-rw-r--r-- | src/util.hpp | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/util.cc b/src/util.cc index d9805f47..d899b2f2 100644 --- a/src/util.cc +++ b/src/util.cc @@ -2002,16 +2002,20 @@ void c_prt(byte attr, cptr str, int row, int col) Term_addstr( -1, attr, str); } -/* -* As above, but in "white" -*/ +void c_prt(byte attr, std::string const &s, int row, int col) +{ + c_prt(attr, s.c_str(), row, col); +} + void prt(cptr str, int row, int col) { - /* Spawn */ c_prt(TERM_WHITE, str, row, col); } - +void prt(std::string const &s, int row, int col) +{ + prt(s.c_str(), row, col); +} /* * Print some (colored) text to the screen at the current cursor position, diff --git a/src/util.hpp b/src/util.hpp index c682b2f2..583fd4aa 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -38,6 +38,8 @@ extern void screen_load(void); extern void c_put_str(byte attr, cptr str, int row, int col); extern void put_str(cptr str, int row, int col); extern void c_prt(byte attr, cptr str, int row, int col); +extern void c_prt(byte attr, std::string const &s, int row, int col); +extern void prt(std::string const &s, int row, int col); extern void text_out_to_screen(byte a, cptr str); extern void text_out_to_file(byte a, cptr str); extern void text_out(cptr str); |