// ---------------------------------------------------------- /* xml_delete.cpp Feb/28/2012 */ // ---------------------------------------------------------- #include #include #include #include #include #include #include #include // ---------------------------------------------------------- using namespace std; using namespace boost; typedef map Unit; extern string file_to_str_proc (char file_in[]); extern void dict_display_proc (map dict_aa); extern map xml_to_dict_proc (string str_xml); extern string dict_to_xml_proc (map dict_aa); // ---------------------------------------------------------- int main (int argc, char* argv[]) { char file_xml[160]; char key_in[10]; cerr << "*** 開始 ***\n"; strcpy (file_xml,argv[1]); strcpy (key_in,argv[2]); cout << key_in << endl; string str_xml = file_to_str_proc (file_xml); map dict_aa = xml_to_dict_proc (str_xml); string key = lexical_cast(key_in); dict_aa.erase (key); dict_display_proc (dict_aa); str_xml = dict_to_xml_proc (dict_aa); ofstream fp_out (file_xml); fp_out << str_xml; fp_out.close (); cerr << "*** 終了 ***\n"; return 0; } // ----------------------------------------------------------