0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
[occt.git] / src / IGESData / IGESData_DefaultSpecific.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <IGESData.hxx>
16 #include <IGESData_DefaultSpecific.hxx>
17 #include <IGESData_IGESDumper.hxx>
18 #include <IGESData_IGESEntity.hxx>
19 #include <IGESData_Protocol.hxx>
20 #include <IGESData_SpecificLib.hxx>
21 #include <IGESData_UndefinedEntity.hxx>
22 #include <Interface_Macros.hxx>
23 #include <Interface_UndefinedContent.hxx>
24 #include <Message_Messenger.hxx>
25 #include <Standard_Type.hxx>
26 #include <TCollection_HAsciiString.hxx>
27
28 IMPLEMENT_STANDARD_RTTIEXT(IGESData_DefaultSpecific,IGESData_SpecificModule)
29
30 IGESData_DefaultSpecific::IGESData_DefaultSpecific ()
31 {  IGESData_SpecificLib::SetGlobal(this, IGESData::Protocol());  }
32
33     void  IGESData_DefaultSpecific::OwnDump
34   (const Standard_Integer /*CN*/, const Handle(IGESData_IGESEntity)& ent,
35    const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S,
36    const Standard_Integer /*own*/) const 
37 {
38   DeclareAndCast(IGESData_UndefinedEntity,lent,ent);
39   if (lent.IsNull()) return;
40
41   Standard_Integer dstat = lent->DirStatus();
42   if (dstat != 0) S
43     << " --  Directory Entry Error Status = " << dstat << "  --" << Message_EndLine;
44   Handle(Interface_UndefinedContent) cont = lent->UndefinedContent();
45   Standard_Integer nb = cont->NbParams();
46   S << " UNDEFINED ENTITY ...\n"<<nb
47     <<" Parameters (WARNING : Odd Integer Values Interpreted as Entities)\n";
48   for (Standard_Integer i = 1; i <= nb; i ++) {
49     Interface_ParamType ptyp = cont->ParamType(i);
50     if (ptyp == Interface_ParamVoid) S<<"       ["<<i<<":Void]";
51     else if (cont->IsParamEntity(i)) {
52       DeclareAndCast(IGESData_IGESEntity,anent,cont->ParamEntity(i));
53       S<<"      ["<<i<<":IGES]=";  
54       dumper.PrintDNum(anent,S);
55     }
56     else {  S<<"        ["<<i<<"]=" << cont->ParamValue(i);  }
57     if ( i == (i%5)*5) S << Message_EndLine;
58   }
59   S << Message_EndLine;
60 }