diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 22:50:06 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 23:06:30 +0200 |
commit | 770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch) | |
tree | e030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/message.h | |
parent | a6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff) | |
download | crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.tar.gz crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.zip |
Use std namespace.
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
Diffstat (limited to 'crawl-ref/source/message.h')
-rw-r--r-- | crawl-ref/source/message.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h index 2b563e53bc..59bf5711ac 100644 --- a/crawl-ref/source/message.h +++ b/crawl-ref/source/message.h @@ -30,16 +30,16 @@ class formatted_string; void formatted_mpr(const formatted_string& fs, msg_channel_type channel = MSGCH_PLAIN, int param = 0); -void formatted_message_history(const std::string &st, +void formatted_message_history(const string &st, msg_channel_type channel = MSGCH_PLAIN, int param = 0, int wrap_col = 0); // mpr() an arbitrarily long list of strings -void mpr_comma_separated_list(const std::string &prefix, - const std::vector<std::string> &list, - const std::string &andc = ", and ", - const std::string &comma = ", ", +void mpr_comma_separated_list(const string &prefix, + const vector<string> &list, + const string &andc = ", and ", + const string &comma = ", ", const msg_channel_type channel = MSGCH_PLAIN, const int param = 0); @@ -52,8 +52,8 @@ void msgwin_set_temporary(bool temp); // message window and history. void msgwin_clear_temporary(); -void msgwin_prompt(std::string prompt); -void msgwin_reply(std::string reply); +void msgwin_prompt(string prompt); +void msgwin_reply(string reply); unsigned int msgwin_lines(); @@ -61,14 +61,14 @@ unsigned int msgwin_lines(); // read, e.g. after reading input from the player. void msgwin_got_input(); -int msgwin_get_line(std::string prompt, +int msgwin_get_line(string prompt, char *buf, int len, input_history *mh = NULL, int (*keyproc)(int &c) = NULL); // Do not use this templated function directly. Use the macro below instead. -template<int> static int msgwin_get_line_autohist_temp(std::string prompt, +template<int> static int msgwin_get_line_autohist_temp(string prompt, char *buf, int len) { static input_history hist(10); @@ -106,18 +106,18 @@ void replay_messages(); void set_more_autoclear(bool on); -std::string get_last_messages(int mcount); -void get_recent_messages(std::vector<std::string> &messages, - std::vector<msg_channel_type> &channels); +string get_last_messages(int mcount); +void get_recent_messages(vector<string> &messages, + vector<msg_channel_type> &channels); int channel_to_colour(msg_channel_type channel, int param = 0); -bool strip_channel_prefix(std::string &text, msg_channel_type &channel, +bool strip_channel_prefix(string &text, msg_channel_type &channel, bool silence = false); namespace msg { - extern std::ostream stream; - std::ostream& streams(msg_channel_type chan = MSGCH_PLAIN); + extern ostream stream; + ostream& streams(msg_channel_type chan = MSGCH_PLAIN); struct setparam { @@ -131,7 +131,7 @@ namespace msg bool m_value; }; - class mpr_stream_buf : public std::streambuf + class mpr_stream_buf : public streambuf { public: mpr_stream_buf(msg_channel_type chan); @@ -153,7 +153,7 @@ namespace msg void deinitialise_mpr_streams(); } -std::ostream& operator<<(std::ostream& os, const msg::setparam& sp); +ostream& operator<<(ostream& os, const msg::setparam& sp); void set_msg_dump_file(FILE* file); |