4 // Copyright (C) 2009-2014 CEA/DEN, EDF R&D
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "HexWitness.hxx"
23 #include "HexDumpStudy.hxx"
24 #include "HexEltBase.hxx"
25 #include "HexDocument.hxx"
29 // =================================================== Constructeur
32 mess_state = NoMessage;
37 // =================================================== operator << (int)
38 Witness& Witness::operator << (int val)
43 sprintf (valeur, "%d", val);
49 // =================================================== operator << (double)
50 Witness& Witness::operator << (double val)
55 sprintf (valeur, "%g", val);
61 // =================================================== operator << (cpchar)
62 Witness& Witness::operator << (cpchar val)
69 // =================================================== operator << (string)
70 Witness& Witness::operator << (rcstring val)
80 // =================================================== operator << (elt)
81 Witness& Witness::operator << (EltBase* elt)
84 cpchar name = elt==NULL ? "<null>" : elt->getName();
88 // =================================================== printMessage
89 void Witness::printMessage ()
91 if (mess_state==NoMessage)
97 int nbre = bla_bla.size();
102 << " ... In function :" << endl;
103 cout << bla_bla [0] << endl << endl;
104 for (int nro=1 ; nro<nbre ; nro++)
105 cout << bla_bla [nro] << endl;
108 // =================================================== getMessage
109 TabText& Witness::getMessage ()
116 // =================================================== sizeofMessage
117 int Witness::sizeofMessage ()
122 return bla_bla.size();
124 // =================================================== getLine
125 cpchar Witness::getLine (int nro)
130 if (nro < 0 || nro >= nbr_lines)
133 return bla_bla[nro].c_str();
136 // -------------------------------------------------------------
137 // ------------ Private
138 // ------------ For members only
139 // -------------------------------------------------------------
140 // =================================================== openMessage
141 void Witness::openMessage ()
143 if (mess_state!=NoMessage)
146 mess_state = MessOpen;
148 if (dump_study == NULL)
155 dump_study->getBegin (curr_line);
158 // =================================================== pushLine
159 void Witness::pushLine ()
161 if (mess_state != MessOpen)
167 bla_bla.push_back (curr_line);
170 nbr_lines = bla_bla.size ();