0031945: Foundation Classes - unique names of alerts of message report in DumpJson
[occt.git] / src / Message / Message_AttributeStream.cxx
1 // Copyright (c) 2020 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 #include <Message_AttributeStream.hxx>
15 #include <Standard_Dump.hxx>
16
17 IMPLEMENT_STANDARD_RTTIEXT(Message_AttributeStream, Message_Attribute)
18
19 //=======================================================================
20 //function : Constructor
21 //purpose  :
22 //=======================================================================
23 Message_AttributeStream::Message_AttributeStream (const Standard_SStream& theStream,
24                                                   const TCollection_AsciiString& theName)
25 : Message_Attribute(theName)
26 {
27   SetStream (theStream);
28 }
29
30 //=======================================================================
31 //function : SetStream
32 //purpose  :
33 //=======================================================================
34 void Message_AttributeStream::SetStream (const Standard_SStream& theStream)
35 {
36   myStream.str ("");
37   myStream << theStream.str().c_str();
38 }
39
40 //=======================================================================
41 //function : DumpJson
42 //purpose  :
43 //=======================================================================
44 void Message_AttributeStream::DumpJson (Standard_OStream& theOStream,
45                                         Standard_Integer theDepth) const
46 {
47   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
48   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Attribute)
49
50   OCCT_DUMP_STREAM_VALUE_DUMPED (theOStream, myStream)
51 }