25 std::ifstream stream(filename.c_str(), std::ios::binary);
26 if (!stream.is_open()) {
27 fprintf(stderr,
"Failed to open LDB file `%s' for reading : %s\n", filename.c_str(), strerror(errno));
34 std::ofstream stream(filename.c_str(), std::ios::binary);
35 if (!stream.is_open()) {
36 fprintf(stderr,
"Failed to open LDB file `%s' for writing : %s\n", filename.c_str(), strerror(errno));
43 std::ofstream stream(filename.c_str(), std::ios::binary);
44 if (!stream.is_open()) {
45 fprintf(stderr,
"Failed to open LDB XML file `%s' for writing : %s\n", filename.c_str(), strerror(errno));
52 std::ifstream stream(filename.c_str(), std::ios::binary);
53 if (!stream.is_open()) {
54 fprintf(stderr,
"Failed to open LDB XML file `%s' for reading : %s\n", filename.c_str(), strerror(errno));
68 if (header.length() != 11) {
72 if (header !=
"LcfDataBase") {
73 fprintf(stderr,
"Warning: This header is not LcfDataBase and might not be a valid RPG2000 database.\n");
80 std::vector<RPG::Actor>::iterator it;
96 header =
"LcfDataBase";
101 writer.
Write(header);
108 if (!writer.
IsOk()) {
120 if (!reader.
IsOk()) {