1 // Created on: 2001-08-30
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <CDM_COutMessageDriver.hxx>
18 #include <Standard_PCharacter.hxx>
19 #include <Standard_Type.hxx>
21 IMPLEMENT_STANDARD_RTTIEXT(CDM_COutMessageDriver,CDM_MessageDriver)
23 //=======================================================================
26 //=======================================================================
27 void CDM_COutMessageDriver::Write (const Standard_ExtString aString)
29 // Find the length of the input string
30 Standard_ExtCharacter aChar = aString[0];
31 Standard_Integer aLength = 0;
33 if (IsAnAscii(aChar) == Standard_False)
35 aChar = aString [++aLength];
38 // Copy the input string to ASCII buffer
39 Standard_PCharacter anAsciiString = new Standard_Character [aLength+2];
40 Standard_Integer anI = 0;
41 while (anI < aLength) {
42 anAsciiString[anI] = Standard_Character (aString[anI]);
45 anAsciiString[anI+0] = '\n';
46 anAsciiString[anI+1] = '\0';
49 cout << anAsciiString << flush;
50 delete [] anAsciiString;