From: Denny V. <vra...@us...> - 2004-10-17 19:13:26
|
Update of /cvsroot/darkeyetool/det/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15658/src Modified Files: LaderXerces.cpp LaderXerces.h Log.cpp Log.h PersistenzManagerXerces.cpp PersistenzManagerXerces.h Update.cpp Update.h det.cpp detVer.h detconfig.cpp detconfig.h Log Message: IDs und Bezeichner getrennt - I18N vorbereitet ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. Aber Entwicklung ohne CVS wird mir zu doof. Vorsicht vor allem mit Helden und RKP. Tausend Kleinigkeiten geaendert. Neue Datensaetze in basis.xdi. Index: PersistenzManagerXerces.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/PersistenzManagerXerces.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PersistenzManagerXerces.cpp 4 Apr 2004 21:06:41 -0000 1.10 +++ PersistenzManagerXerces.cpp 17 Oct 2004 19:12:39 -0000 1.11 @@ -12,21 +12,71 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl //@<< includes >> //@+node:<< includes >> #include "PersistenzManagerXerces.h" +#include "dsa/Texte.h" +#include "dsa/NDSAUtil.h" +//@nonl //@-node:<< includes >> //@nl @@ -81,12 +131,12 @@ //@+node:Version std::string PersistenzManagerXerces::Version() const { std::string v; - lader_->LeseAttribut(lader_->Wurzel(), _t("version"), &v); + lader_->LeseAttribut(lader_->Wurzel(), "version", &v); return v; } // Version void PersistenzManagerXerces::Version(const std::string& version) { - lader_->AttributiereKnoten(lader_->Wurzel(), _t("version"), version); + lader_->AttributiereKnoten(lader_->Wurzel(), "version", version); } // Version //@-node:Version @@ -172,21 +222,77 @@ rv += SchliesseNachLesen(); return rv; } // Lese - - int PersistenzManagerXerces::Lese (StringListe& liste, const std::string& einzeltag, const std::string& tag, std::string id) { - liste.clear(); - if (!Existiert(tag, id)) return 0; - int rv = OeffneZumLesen(tag, id); - bool offen = (rv==0); - int x = Anzahl(einzeltag); - for (int i = 0; i < x; ++i) { + +//@+others +//@+node:Lese StringListe +int PersistenzManagerXerces::Lese (StringListe& liste, const std::string& einzeltag, const std::string& tag, std::string id) { + liste.clear(); + if (!Existiert(tag, id)) return 0; + int rv = OeffneZumLesen(tag, id); + bool offen = (rv==0); + int x = Anzahl(einzeltag); + for (int i = 0; i < x; ++i) { + std::string s; + rv += LeseMehrfach(einzeltag, s, i); + liste.push_back(s); + } + if (offen) rv += SchliesseNachLesen(); + return rv; +} // Lese StringListe +//@nonl +//@-node:Lese StringListe +//@+node:Lese DDict +int PersistenzManagerXerces::Lese (DDict& dict, const std::string& einzeltag, const std::string& tag, std::string id, const std::string& oberid) { + dict.clear(); + if (!Existiert(tag, id)) return 0; + int rv = OeffneZumLesen(tag, id); + bool offen = (rv==0); + + if (Existiert(einzeltag)) { + StringListe pfad; + pfad.push_back(einzeltag); + xercesc::DOMElement* node = 0; + lader_->gehePfad(pfad, &node, 0, knoten_); + if (!lader_->ExistiertAttribut(node, "ID")) { + rv += SchliesseNachLesen(); + //return 0; + StringListe sl; + rv += Lese(sl, einzeltag, tag, id); + for (StringListe::const_iterator i = sl.begin(); i != sl.end(); ++i) { + Dict d; + d[DSA::StandardLang()] = *i; + dict[strings::MacheID(einzeltag, oberid + *i)] = d; + } + return rv; + } + } + + StringListe liste; + rv += IDListe(einzeltag, &liste); + + for (StringListe::const_iterator i = liste.begin(); i != liste.end(); ++i) { + std::string id = *i; + int rv2 = OeffneZumLesen(einzeltag, id); + if (rv2!=0) { rv += rv2; continue; } + + StringListe langs; + rv += IDListe("Bezeichnung", &langs); + Dict d; + for (StringListe::const_iterator j = langs.begin(); j != langs.end(); ++j) { std::string s; - rv += LeseMehrfach(einzeltag, s, i); - liste.push_back(s); + rv += Lese("Bezeichnung", *j, s); + d[*j] = s; } - if (offen) rv += SchliesseNachLesen(); - return rv; - } // Lese StringListe + dict[*i] = d; + rv += SchliesseNachLesen(); + } + + if (offen) rv += SchliesseNachLesen(); + return rv; +} +//@nonl +//@-node:Lese DDict +//@-others //@nonl //@-node:Lese //@+node:LeseMehrfach @@ -283,16 +389,38 @@ rv += SchliesseNachSchreiben(); return rv; } // Schreibe - - int PersistenzManagerXerces::Schreibe (const StringListe& liste, const std::string& einzeltag, const std::string& tag, const std::string& id) { - if (liste.size()==0) return 0; - int rv = OeffneZumSchreiben(tag, id); + +//@+others +//@+node:Schreibe StringListe +int PersistenzManagerXerces::Schreibe (const StringListe& liste, const std::string& einzeltag, const std::string& tag, const std::string& id) { + if (liste.size()==0) return 0; + int rv = OeffneZumSchreiben(tag, id); // if (rv!=0) return rv; - for (StringListe::const_iterator s = liste.begin(); s != liste.end(); ++s) - rv += SchreibeMehrfach(einzeltag, *s); + for (StringListe::const_iterator s = liste.begin(); s != liste.end(); ++s) + rv += SchreibeMehrfach(einzeltag, *s); + rv += SchliesseNachSchreiben(); + return rv; +} // Schreibe StringListe +//@nonl +//@-node:Schreibe StringListe +//@+node:Schreibe DDict +int PersistenzManagerXerces::Schreibe (const DDict& dict, const std::string& einzeltag, const std::string& tag, const std::string& id) { + if (dict.size()==0) return 0; + int rv = OeffneZumSchreiben(tag, id); + for (DDict::const_iterator i = dict.begin(); i != dict.end(); ++i) { + rv += OeffneZumSchreiben(einzeltag, i->first); + for (Dict::const_iterator j = i->second.begin(); j != i->second.end(); ++j) { + rv += Schreibe("Bezeichnung", j->first, j->second); + } rv += SchliesseNachSchreiben(); - return rv; - } // Schreibe StringListe + } + rv += SchliesseNachSchreiben(); + return rv; +} + +//@-node:Schreibe DDict +//@-others +//@nonl //@-node:Schreibe //@+node:SchreibeMehrfach int PersistenzManagerXerces::SchreibeMehrfach (const std::string& tag, const std::string& wert) { @@ -356,6 +484,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.11 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.10 2004/04/04 21:06:41 vrandezo // Bug: wurde nach einem Knoten mit ID gesucht, und kam zuvor ein // Knoten ohne ID, fuehrte das zu einem Absturz Index: LaderXerces.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/LaderXerces.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- LaderXerces.cpp 4 Apr 2004 21:06:41 -0000 1.10 +++ LaderXerces.cpp 17 Oct 2004 19:12:38 -0000 1.11 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -38,7 +85,7 @@ #include <fstream> #include "Log.h" -#include "dsa/Texte.h" +//#include "dsa/Texte.h" //@-node:<< includes >> //@nl @@ -70,7 +117,7 @@ catch (const xercesc::XMLException& toCatch) { - Log::Error(_t("Fehler während der XML-Initalisierung")); + Log::Error("Fehler während der XML-Initalisierung"); //Log::Add(StrX(toCatch.getMessage()), Log::Error); return; } @@ -87,8 +134,8 @@ Wurzel()->setAttribute(X(std::string("version")), X(std::string("1.01"))); Wurzel()->setAttribute(X(std::string("lang")), X(std::string("de"))); - m_Fehler = _t("kein Fehler gemeldet"); - Log::Info(_t("Lader initialisiert")); + m_Fehler = "kein Fehler gemeldet"; + Log::Info("Lader initialisiert"); } //@nonl //@-node:LaderXerces @@ -102,7 +149,7 @@ LaderXerces::~LaderXerces() { parser->release(); - Log::Info(_t("Lader destruiert")); + Log::Info("Lader destruiert"); } //@nonl //@-node:LaderXerces @@ -137,7 +184,7 @@ // TODO Hier müssen Fehlerbehandlung // und anderes rein! - Log::Debug("Lader::Lade " + _t("beendet")); + Log::Debug("Lader::Lade beendet"); return 0; } @@ -324,6 +371,7 @@ { xercesc::DOMNamedNodeMap* attribs = kinder->item(j)->getAttributes(); xercesc::DOMNode* idNode = attribs->getNamedItem(xercesc::XMLString::transcode("ID")); + if (idNode == 0) continue; liste->push_back(x2s(idNode->getNodeValue())); } @@ -341,12 +389,12 @@ int LaderXerces::LeseString (const StringListe& Pfad, std::string* Inhalt) { - Log::Error("Lader::LeseString " + _t("nicht implementiert")); + Log::Error("Lader::LeseString nicht implementiert"); xercesc::DOMElement* node; int rv = gehePfad(Pfad, &node); if (rv) return rv; // Inhalt->assign(x2s(node->getNodeValue())); // Falsch! - Log::Info("Lader::LeseString " + _t("nicht implementiert")); + Log::Info("Lader::LeseString nicht implementiert"); return 0; } //@nonl @@ -382,7 +430,7 @@ int LaderXerces::LeseInteger (const StringListe& Pfad, int* Inhalt) { - Log::Error("Lader::LeseString " + _t("nicht implementiert")); + Log::Error("Lader::LeseString nicht implementiert"); return 0; } //@nonl @@ -418,7 +466,7 @@ int LaderXerces::SchreibeString (const StringListe& Pfad, std::string Inhalt) { - Log::Error("Lader::SchreibeString " + _t("nicht implementiert")); + Log::Error("Lader::SchreibeString nicht implementiert"); return 0; } //@nonl @@ -448,7 +496,7 @@ int LaderXerces::SchreibeInteger (const StringListe& Pfad, int Inhalt) { - Log::Error("Lader::SchreibeString " + _t("nicht implementiert")); + Log::Error("Lader::SchreibeString nicht implementiert"); return 0; } //@nonl @@ -481,7 +529,7 @@ bool Ueberschreiben, std::string ID) { - Log::Error("Lader::NeuerKnoten " + _t("nicht implementiert")); + Log::Error("Lader::NeuerKnoten nicht implementiert"); return 0; } //@nonl @@ -503,7 +551,7 @@ return rv; xercesc::DOMElement* neuerKnoten = doc->createElement(X(Bezeichner)); - if (ID!="") neuerKnoten->setAttribute(X(_t("ID")), X(ID)); + if (ID!="") neuerKnoten->setAttribute(X(std::string("ID")), X(ID)); knoten->appendChild(neuerKnoten); return rv; @@ -602,7 +650,7 @@ int LaderXerces::LoescheKnoten (const StringListe& Pfad) { - Log::Error("Lader::LoescheKnoten " + _t("nicht implementiert")); + Log::Error("Lader::LoescheKnoten nicht implementiert"); return 0; } //@nonl @@ -740,7 +788,7 @@ std::string Attribut, std::string Attributswert) { - Log::Error("Lader::AttributiereKnoten " + _t("nicht implementiert")); + Log::Error("Lader::AttributiereKnoten nicht implementiert"); return 0; } //@nonl @@ -1186,6 +1234,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.11 2004/10/17 19:12:38 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.10 2004/04/04 21:06:41 vrandezo // Bug: wurde nach einem Knoten mit ID gesucht, und kam zuvor ein // Knoten ohne ID, fuehrte das zu einem Absturz Index: Log.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/Log.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Log.cpp 24 Oct 2003 13:26:02 -0000 1.3 +++ Log.cpp 17 Oct 2004 19:12:38 -0000 1.4 @@ -11,15 +11,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -68,6 +115,14 @@ //@<< Version history >> //@+node:<< Version History >> // $Log$ +// Revision 1.4 2004/10/17 19:12:38 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.3 2003/10/24 13:26:02 vrandezo // DEBUG_NEW raus // Index: detVer.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/detVer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- detVer.h 4 Dec 2003 17:10:50 -0000 1.4 +++ detVer.h 17 Oct 2004 19:12:39 -0000 1.5 @@ -11,15 +11,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -45,6 +92,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.5 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.4 2003/12/04 17:10:50 vrandezo // Trons BSD-Portierung // Index: Update.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/Update.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Update.h 28 Nov 2003 16:45:03 -0000 1.3 +++ Update.h 17 Oct 2004 19:12:39 -0000 1.4 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -57,6 +104,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.4 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.3 2003/11/28 16:45:03 vrandezo // Zeilenvorlauf am Dateiende (Warnung bei gcc) // Index: detconfig.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/detconfig.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- detconfig.cpp 7 Jan 2004 22:02:42 -0000 1.2 +++ detconfig.cpp 17 Oct 2004 19:12:39 -0000 1.3 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. // +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -28,7 +75,7 @@ //@+node:<< includes >> #include "detconfig.h" #include "Log.h" -#include "dsa/Texte.h" +//#include "dsa/Texte.h" #include "LaderXerces.h" //@nonl //@-node:<< includes >> @@ -67,13 +114,15 @@ void detConfig::Reset() { boolOptionen_ = std::map<std::string, bool>(); boolOptionen_["Warnung beim Re-Generieren"] = true; + stringOptionen_ = std::map<std::string, std::string>(); + stringOptionen_["Sprache"] = "Deutsch"; } // Reset bool detConfig::boolOption(const std::string& option) const { std::map<std::string, bool>::const_iterator i = boolOptionen_.find(option); if (i != boolOptionen_.end()) return i->second; - Log::Add(_t("Unbekannte Option") + ": " + _t(option)); + Log::Add("Unbekannte Option: " + option); return false; } // boolOption @@ -81,26 +130,55 @@ boolOptionen_[option] = b; } // boolOption +std::string detConfig::stringOption(const std::string& option) const { + std::map<std::string, std::string>::const_iterator i = stringOptionen_.find(option); + if (i != stringOptionen_.end()) + return i->second; + Log::Add("Unbekannte Option: " + option); + return ""; +} // stringOption + +void detConfig::stringOption(const std::string& option, const std::string& s) { + stringOptionen_[option] = s; +} // stringOption + int detConfig::Lese(const std::string& dateiname) { Reset(); LaderXerces* l = new LaderXerces(); l->Lade(dateiname); if (l->DocLeer()) { delete l; return 0; } - int z = l->AnzahlKnoten(l->Wurzel(), _t("boolOption")); + int z = l->AnzahlKnoten(l->Wurzel(), "boolOption"); if (z>0) { StringListe ids; - l->IDListe(l->Wurzel(), _t("boolOption"), &ids); + l->IDListe(l->Wurzel(), "boolOption", &ids); for (StringListe::iterator s = ids.begin(); s != ids.end(); ++s) { xercesc::DOMElement* node = 0; StringListe sl; sl.push_back("detconfig"); - sl.push_back(_t("boolOption")); - sl.push_back(_t("ID")); - sl.push_back(_t(*s)); + sl.push_back("boolOption"); + sl.push_back("ID"); + sl.push_back(*s); l->gehePfad(sl, &node); std::string w; l->LeseString(node, &w); - boolOptionen_[*s] = (w==_t("ja")); + boolOptionen_[*s] = (w=="ja"); + } + } + z = l->AnzahlKnoten(l->Wurzel(), "stringOption"); + if (z>0) { + StringListe ids; + l->IDListe(l->Wurzel(), "stringOption", &ids); + for (StringListe::iterator s = ids.begin(); s != ids.end(); ++s) { + xercesc::DOMElement* node = 0; + StringListe sl; + sl.push_back("detconfig"); + sl.push_back("stringOption"); + sl.push_back("ID"); + sl.push_back(*s); + l->gehePfad(sl, &node); + std::string w; + l->LeseString(node, &w); + stringOptionen_[*s] = w; } } delete l; @@ -111,15 +189,26 @@ LaderXerces* l = new LaderXerces(); l->NeuesDokument(dateiname, "detconfig"); for (std::map<std::string, bool>::const_iterator i = boolOptionen_.begin(); i != boolOptionen_.end(); ++i) { - l->NeuerKnoten(l->Wurzel(), _t("boolOption"), _t(i->first)); + l->NeuerKnoten(l->Wurzel(), "boolOption", i->first); xercesc::DOMElement* node = 0; StringListe sl; sl.push_back("detconfig"); - sl.push_back(_t("boolOption")); - sl.push_back(_t("ID")); - sl.push_back(_t(i->first)); + sl.push_back("boolOption"); + sl.push_back("ID"); + sl.push_back(i->first); l->gehePfad(sl, &node); - l->SchreibeString(node, (i->second ? _t("ja") : _t("nein"))); + l->SchreibeString(node, (i->second ? "ja" : "nein")); + } + for (std::map<std::string, std::string>::const_iterator i = stringOptionen_.begin(); i != stringOptionen_.end(); ++i) { + l->NeuerKnoten(l->Wurzel(), "stringOption", i->first); + xercesc::DOMElement* node = 0; + StringListe sl; + sl.push_back("detconfig"); + sl.push_back("stringOption"); + sl.push_back("ID"); + sl.push_back(i->first); + l->gehePfad(sl, &node); + l->SchreibeString(node, i->second); } l->Speicher(dateiname); return 0; @@ -130,6 +219,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.3 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.2 2004/01/07 22:02:42 dertron // Pfad in #include enthielt \, in / geändert // Index: detconfig.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/detconfig.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- detconfig.h 6 Jan 2004 03:52:49 -0000 1.1 +++ detconfig.h 17 Oct 2004 19:12:39 -0000 1.2 @@ -13,15 +13,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. // +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl //@<< includes >> @@ -48,10 +95,14 @@ bool boolOption(const std::string& option) const; void boolOption(const std::string& option, bool b); + std::string stringOption(const std::string& option) const; + void stringOption(const std::string& option, const std::string& s); int Lese(const std::string& datei); int Schreibe(const std::string& datei) const; + static std::string Sprache() { return detConfig::Config()->stringOption("Sprache"); } + private: detConfig(); virtual ~detConfig() {}; @@ -59,6 +110,7 @@ static detConfig* singleton_; std::map<std::string, bool> boolOptionen_; + std::map<std::string, std::string> stringOptionen_; }; // detConfig //@nonl //@-node:<< class detConfig >> @@ -69,6 +121,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.2 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.1 2004/01/06 03:52:49 vrandezo // detConfig für Applikationskonfigurationsdaten hinzugefügt // Index: PersistenzManagerXerces.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/PersistenzManagerXerces.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PersistenzManagerXerces.h 4 Apr 2004 17:29:04 -0000 1.6 +++ PersistenzManagerXerces.h 17 Oct 2004 19:12:39 -0000 1.7 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) // +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -61,6 +108,7 @@ virtual int LeseMehrfach (const std::string& tag, std::string& wert, int nr); virtual int LeseMehrfach (const std::string& tag, int& wert, int nr); virtual int Lese (StringListe& liste, const std::string& einzeltag, const std::string& tag, std::string id); + virtual int Lese (DDict& dict, const std::string& einzeltag, const std::string& tag, std::string id, const std::string& oberid = ""); virtual int Anzahl (const std::string& tag, const std::string& id = ""); virtual int SchliesseNachLesen(); @@ -73,6 +121,7 @@ virtual int SchreibeMehrfach (const std::string& tag, const std::string& wert); virtual int SchreibeMehrfach (const std::string& tag, int wert); virtual int Schreibe (const StringListe& liste, const std::string& einzeltag, const std::string& tag, const std::string& id=""); + virtual int Schreibe (const DDict& dict, const std::string& einzeltag, const std::string& tag, const std::string& id=""); virtual int SchliesseNachSchreiben(); virtual int SchreibePI (const std::string& target, const std::string& data = ""); @@ -106,6 +155,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.7 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.6 2004/04/04 17:29:04 vrandezo // Re-Generierungs-bug gefixt // Index: Update.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/Update.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Update.cpp 13 Jul 2004 18:59:52 -0000 1.7 +++ Update.cpp 17 Oct 2004 19:12:39 -0000 1.8 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -138,6 +185,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.8 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.7 2004/07/13 18:59:52 twel // nur ein Test // Index: LaderXerces.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/LaderXerces.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- LaderXerces.h 4 Apr 2004 17:29:04 -0000 1.8 +++ LaderXerces.h 17 Oct 2004 19:12:38 -0000 1.9 @@ -12,15 +12,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -133,6 +180,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.9 2004/10/17 19:12:38 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.8 2004/04/04 17:29:04 vrandezo // Re-Generierungs-bug gefixt // Index: Log.h =================================================================== RCS file: /cvsroot/darkeyetool/det/src/Log.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Log.h 28 Nov 2003 16:45:03 -0000 1.3 +++ Log.h 17 Oct 2004 19:12:39 -0000 1.4 @@ -22,15 +22,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. // +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. +// +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -87,6 +134,14 @@ //@<< Version History >> //@+node:<< Version History >> // $Log$ +// Revision 1.4 2004/10/17 19:12:39 vrandezo +// IDs und Bezeichner getrennt - I18N vorbereitet +// ACHTUNG! Daten sichern. Das Programm ist noch reichlich fehlerhaft. +// Aber Entwicklung ohne CVS wird mir zu doof. +// Vorsicht vor allem mit Helden und RKP. +// Tausend Kleinigkeiten geaendert. +// Neue Datensaetze in basis.xdi. +// // Revision 1.3 2003/11/28 16:45:03 vrandezo // Zeilenvorlauf am Dateiende (Warnung bei gcc) // Index: det.cpp =================================================================== RCS file: /cvsroot/darkeyetool/det/src/det.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- det.cpp 25 Apr 2004 17:18:51 -0000 1.54 +++ det.cpp 17 Oct 2004 19:12:39 -0000 1.55 @@ -7,8 +7,8 @@ //@<< Version >> //@+node:<< Version >> -#define detVERSION "1.32" -#define detWEBSITE "darkeyetool.sourceforge.net" +#define detVERSION "1.33 Beta" +#define detWEBSITE "dsa4.teclador.com" #define detEMAIL "de...@no..." //@-node:<< Version >> //@nl @@ -28,15 +28,62 @@ //@<< header >> //@+node:<< header >> //@+at -// The content of this file is subject to the license -// given in license.txt +// Copyright (c) 2002-2004, Zdenko Denny Vrandecic and +// contributors. +// All rights reserved. +// (The license follows closely the new +// BSD-OpenSource-License) +// +// Redistribution and use in source and binary forms, with +// or without +// modification, are permitted provided that the following +// conditions are met: +// Redistributions of source code must retain the above +// copyright notice, this list of conditions and the +// following disclaimer. +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the +// following disclaimer in the documentation +// and/or other materials provided with the distribution. +// Neither the name of the copyrightholder or one of the +// contributers to this source may be used to endorse or +// promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// If you use this source, please inform me, so I can keep +// track of how useful it really is. That would be very +// appreciated. // +// The data distributed with this code is copyrighted by +// Fantasy Production, Erkrath, Germany, and *not* subject +// to the here given license. Distributing and using this +// data is granted by FanPro for the purpose of using +// computer driven tools for the role playing game "Das +// Schwarze Auge" / "The Dark Eye". Any other use is only +// allowed with prior written permission by FanPro. //@-at //@@c #ifdef MSVC #pragma warning(disable:4786 4503) #endif + //@-node:<< header >> //@nl @@ -185,6 +232,8 @@ void OnEinstellungenGPErfahren(wxCommandEvent& event); void OnEinstellungenGPVeteran(wxCommandEvent& event); void OnEinstellungenKonstanten(wxCommandEvent& event); + void OnEinstellungenSpracheDeutsch(wxCommandEvent& event); + void OnEinstellungenSpracheEnglisch(wxCommandEvent& event); void OnHilfeHilfe(wxCommandEvent& event); void OnHilfeLog(wxCommandEvent& event); void OnHilfeViellog(wxCommandEvent& event); @@ -199,32 +248,33 @@ //@ << Schreibe >> //@+node:<< Schreibe >> - template<class T> - void Schreibe(T t, DSA::PersistenzManager* pm) { - Put(_t("Speicher") + " " + t->Klassen() + " ... ", false); - Put(t->Schreibe(pm) ? _t("Fehler") : _t("OK")); - } // Schreibe + template<class T> + void Schreibe(T t, DSA::PersistenzManager* pm) { + Put(_t("Speicher") + " " + _t(t->Klassen()) + " ... ", false); + Put(t->Schreibe(pm) ? _t("Fehler") : _t("OK")); + } // Schreibe //@-node:<< Schreibe >> //@nl //@ << Lese >> //@+node:<< Lese >> - template<class T> - void Lese(T t, DSA::PersistenzManager* pm) { - Put(_t("Lade") + " " + t->Klassen() + " ... ", false); - Put(t->Lese(pm) ? _t("Fehler") : _t("OK")); - } // Lese + template<class T> + void Lese(T t, DSA::PersistenzManager* pm) { + Put(_t("Lade") + " " + _t(t->Klassen()) + " ... ", false); + Put(t->Lese(pm) ? _t("Fehler") : _t("OK")); + } // Lese //@-node:<< Lese >> //@nl //@ << Pruefe >> //@+node:<< Pruefe >> - template<class T> - int Pruefe(T t) { - Put(_t("Prüfe") + " " + strings::int2sStr(t->size()) + " " + t->Klassen() + " ... ", false); - int rv = t->Pruefe(); - Put(rv ? _t("Fehler") : _t("OK")); - return rv; - } // Pruefe + template<class T> + int Pruefe(T t) { + Put(_t("Prüfe") + " " + strings::int2sStr(t->size()) + " " + _t(t->Klassen()) + " ... ", false); + int rv = t->Pruefe(); + Put(rv ? _t("Fehler") : _t("OK")); + return rv; + } // Pruefe + //@-node:<< Pruefe >> //@nl @@ -286,6 +336,9 @@ det_Einstellungen_GP_Veteran, det_Einstellungen_GPSub, det_Einstellungen_Konstanten, + det_Einstellungen_Sprache_Deutsch, + det_Einstellungen_Sprache_Englisch, + det_Einstellungen_SpracheSub, det_Hilfe_Hilfe, det_Hilfe_Log, det_Hilfe_Viellog, @@ -326,64 +379,85 @@ // set the frame icon SetIcon(wxICON(DSA)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); // TODOPORT - - // create a menu bar // TODO noch nicht geTextet - wxMenu* menuDaten = new wxMenu("", wxMENU_TEAROFF); - menuDaten->Append(det_Daten_Laden, "Datenbasis neu &laden", "Lädt die Datenbasis für das Werkzeug"); - menuDaten->Append(det_Daten_Speichern, "Datenbasis &speichern\tCtrl-S", "Sichert alle Daten"); - menuDaten->Append(det_Daten_Waehlen, "&Verzeichnis für Datenbasis wählen", "Bestimmt das Standardverzeichnis für die Datenbasis"); - menuDaten->Append(det_Daten_Speichern_Unter, "Speichern Datenbasis &unter...", "Sichert alle Daten unter dem anzugebenden Dateinamen"); + + //@ << menu >> + //@+node:<< menu >> + //@<< Daten >> + //@+node:<< Daten >> + // create a menu bar // TODO noch nicht geTextet + wxMenu* menuDaten = new wxMenu("", wxMENU_TEAROFF); + menuDaten->Append(det_Daten_Laden, _t("MenuDatenLaden").c_str(), _t("MenuDatenLadenInfo").c_str()); + menuDaten->Append(det_Daten_Speichern, (_t("MenuDatenSpeichern") +"\tCtrl-S").c_str(), _t("MenuDatenSpeichernInfo").c_str()); + menuDaten->Append(det_Daten_Waehlen, _t("MenuDatenWaehlen").c_str(), _t("MenuDatenWaehlenInfo").c_str()); + menuDaten->Append(det_Daten_Speichern_Unter, _t("MenuDatenSpeichernUnter").c_str(), _t("MenuDatenSpeichernUnterInfo").c_str()); menuDaten->AppendSeparator(); - menuDaten->Append(det_Daten_Importieren, "&Importieren\tCtrl-I", "Fügt Daten in die offene Datenbasis ein"); - menuDaten->Append(det_Daten_Exportieren, "&Exportieren\tCtrl-E", "Schreibt ausgewählte Datensätze in eine Datei"); + menuDaten->Append(det_Daten_Importieren, _t("MenuDatenImportieren").c_str(), _t("MenuDatenImportierenInfo").c_str()); + menuDaten->Append(det_Daten_Exportieren, _t("MenuDatenExportieren").c_str(), _t("MenuDatenExportierenInfo").c_str()); menuDaten->AppendSeparator(); - menuDaten->Append(det_Daten_Pruefen, "&Prüfen", "Prüft die Daten auf Konsistenz"); -#ifdef _DEBUG - menuDaten->Append(det_Daten_Debug, "Testskript\tAlt-T"); -#endif + menuDaten->Append(det_Daten_Pruefen, _t("MenuDatenPruefen").c_str(), _t("MenuDatenPruefenInfo").c_str()); + #ifdef _DEBUG + menuDaten->Append(det_Daten_Debug, _t("MenuDatenDebug").c_str(), _t("MenuDatenDebugInfo").c_str()); + #endif menuDaten->AppendSeparator(); - menuDaten->Append(det_Da... [truncated message content] |