0022627: Change OCCT memory management defaults
[occt.git] / src / CDM / CDM_COutMessageDriver.cxx
CommitLineData
7fd59977 1// File: CDM_COutMessageDriver.cxx
2// Created: Thu Aug 30 15:50:11 2001
3// Author: Alexander GRIGORIEV
4// Copyright: Open Cascade 2001
5// History:
6
7#include <CDM_COutMessageDriver.ixx>
8#include <Standard_PCharacter.hxx>
9//=======================================================================
10//function : Write
11//purpose :
12//=======================================================================
13
14void CDM_COutMessageDriver::Write (const Standard_ExtString aString)
15{
16 // Find the length of the input string
17 Standard_ExtCharacter aChar = aString[0];
18 Standard_Integer aLength = 0;
19 while (aChar) {
20 if (IsAnAscii(aChar) == Standard_False)
21 return;
22 aChar = aString [++aLength];
23 }
24
25 // Copy the input string to ASCII buffer
26 Standard_PCharacter anAsciiString = new Standard_Character [aLength+2];
27 Standard_Integer anI = 0;
28 while (anI < aLength) {
29 anAsciiString[anI] = Standard_Character (aString[anI]);
30 ++ anI;
31 }
32 anAsciiString[anI+0] = '\n';
33 anAsciiString[anI+1] = '\0';
34
35 // Output
36 cout << anAsciiString << flush;
37 delete anAsciiString;
38}