38static const char lc_name[] =
"LC_MESSAGES";
41void Def::process_messages()
46 int nesting_level = 0;
48 messages_def_found_ =
true;
60 if (nesting_level == 0)
67 "wrong section name in END directive\n");
75 "expected string following \"copy\" directive\n");
102 messages_st_.yesexpr = convert_string (next.
name);
103 messages_st_.wyesexpr = convert_wstring (next);
109 messages_st_.noexpr = convert_string (next.
name);
110 messages_st_.wnoexpr = convert_wstring (next);
123 assert (!dir_name.empty());
125 if (messages_written_)
128 if (!messages_def_found_) {
130 "%s section not found, skipping\n", lc_name);
138 std::ofstream
out (dir_name.c_str(), std::ios::binary);
139 out.exceptions (std::ios::failbit | std::ios::badbit);
142 messages_out_.yesexpr_off[1] = 0;
143 messages_out_.noexpr_off[1] = unsigned (messages_out_.yesexpr_off[1]
144 + (messages_st_.wyesexpr.size() + 1) * sizeof (
wchar_t));
147 messages_out_.yesexpr_off[0] = unsigned (messages_out_.noexpr_off[1]
148 + (messages_st_.wnoexpr.size() + 1) * sizeof (
wchar_t));
149 messages_out_.noexpr_off[0] = unsigned (messages_out_.yesexpr_off[0]
150 + (messages_st_.yesexpr.size() + 1) * sizeof (
char));
152 messages_out_.codeset_off = unsigned (messages_out_.noexpr_off[0]
153 + (messages_st_.noexpr.size() + 1) * sizeof (
char));
154 messages_out_.charmap_off = unsigned (messages_out_.codeset_off
158 out.write ((
char*)&messages_out_,
sizeof(messages_out_));
161 out.write ((
const char*)messages_st_.wyesexpr.c_str(),
162 (messages_st_.wyesexpr.size() + 1) * sizeof (
wchar_t));
163 out.write ((
const char*)messages_st_.wnoexpr.c_str(),
164 (messages_st_.wnoexpr.size() + 1) * sizeof (
wchar_t));
166 out << messages_st_.yesexpr << std::ends;
167 out << messages_st_.noexpr << std::ends;
const std::string & get_code_set_name() const
std::string get_charmap_name() const
void write_messages(std::string dir_name)
void open(std::string, char='#', char='\\')
std::string strip_quotes(const std::string &str)
bool issue_diag(int type, bool, const Scanner::token_t *token, const char *fmt,...)
std::string get_pathname(const std::string &fname, const std::string &other)