+// ======================================================== loadAllDocs
+int Hex::loadAllDocs (cpchar stream)
+{
+ int posit = 0;
+ int car = ' ';
+ int nbdocs = 0;
+
+ while ( (car=stream[posit++]) != '>')
+ if (car>='0' && car <='9')
+ nbdocs = 10*nbdocs + car - '0';
+
+ for (int nro = 0; nro<nbdocs ; nro++)
+ {
+ Document* doc = addDocument ("xxxx");
+ doc->setXml (stream, posit);
+ }
+
+ PutData (posit);
+ return HOK;
+}
+// ======================================================== saveAllDocs
+int Hex::saveAllDocs (cpchar filename)
+{
+ FILE* fic = fopen (filename, "w");
+ if (fic==NULL)
+ return HERR;
+
+ int nbdocs = countDocument ();
+ fprintf (fic, "<%d>", nbdocs);
+
+ for (int nro = 0; nro<nbdocs ; nro++)
+ {
+ Document* doc = getDocument (nro);
+ if (doc!=NULL)
+ doc->appendXml (fic);
+ }
+
+ fclose (fic);
+ return HOK;
+}
+// ======================================================== findDocument
+Document* Hex::findDocument (cpchar name)
+{
+ int nbdocs = liste_documents.size();
+ for (int nro = 0; nro<nbdocs ; nro++)
+ {
+ Document* doc = getDocument (nro);
+ if (doc!=NULL && Cestegal (name, doc->getName ()))
+ return doc;
+ }
+ return NULL;
+}
+// ======================================================== makeName
+void Hex::makeName (cpchar radical, string& name)
+{
+ char cnum [8];
+ int numero = 0;
+ while (true)
+ {
+ name = radical;
+ if (numero>0)
+ {
+ sprintf (cnum, "_%d", numero);
+ name += cnum;
+ }
+ numero ++;
+ if (findDocument (name)==NULL)
+ return;
+ }
+}
+// ======================================================== lockDump
+void Hex::lockDump ()
+{
+ glob->dump.lock ();
+}
+// ======================================================== restoreDump
+void Hex::restoreDump ()
+{
+ glob->dump.restore (DumpActif);
+}
+// ====================================================== getInstance
+Hex* Hex::getInstance ()
+{
+ if (first_instance==NULL)
+ first_instance = new Hex ();
+
+ return first_instance;
+}
+// ======================================================== what (?)
+void Hex::what ()
+{
+ bool actif = glob->dump.start ("hexablock", "what", false);
+
+ Globale* glob = Globale::getInstance ();
+ glob->mess.printMessage();
+
+ glob->dump.close (actif);
+}
+// ======================================================== sizeofMessage
+int Hex::sizeofMessage ()
+{
+ return glob->mess.sizeofMessage ();
+}
+// ======================================================== getMessageLine
+cpchar Hex::getMessageLine (int nlig)
+{
+ return glob->mess.getLine (nlig);
+}
+// ======================================================== hex_instance
+Hex* hex_instance ()
+{
+ Hex* hexa = Hex::getInstance ();
+ return hexa;
+}
+// ======================================================== what (fonction)
+void what ()
+{
+ Hex* hexa = Hex::getInstance ();
+ hexa->what ();
+}
+