void font::clear_cache() { for (dictionary<shared_pointer<font_impl>, string>::iterator i = fonts.iter(); i.is_valid(); ++i) { if (i->get_ref_count() > 1) { gsgl::log(string::format(L"Dangling font reference: '%ls'!", i.get_index().w_string())); throw runtime_exception(L"Dangling font reference: '%ls'!", i.get_index().w_string()); } } fonts.clear(); } // font::clear_cache()
void decode_map(dictionary &data, const string &src) { osctl::string_buffer sb(src); osc_stream<osctl::string_buffer> str(sb); uint32_t count = 0; str >> count; string tmp, tmp2; data.clear(); for (uint32_t i = 0; i < count; i++) { str >> tmp; str >> tmp2; data[tmp] = tmp2; } }