0027853: Visualization, OpenGl_Texture - optimize sequential upload of texture image
[occt.git] / src / OSD / OSD_Printer.cxx
1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #ifndef _WIN32
16
17
18 #include <OSD_OSDError.hxx>
19 #include <OSD_Printer.hxx>
20 #include <OSD_WhoAmI.hxx>
21 #include <Standard_ConstructionError.hxx>
22 #include <Standard_NullObject.hxx>
23 #include <TCollection_AsciiString.hxx>
24
25 #include <errno.h>
26 //const OSD_WhoAmI Iam = OSD_WPrinter;
27 // -------------------------------------------------------------
28 // -------------------------------------------------------------
29 OSD_Printer::OSD_Printer (const TCollection_AsciiString& Name){
30  SetName(Name);
31 }
32
33
34 // -------------------------------------------------------------
35 // -------------------------------------------------------------
36 void OSD_Printer::SetName (const TCollection_AsciiString& Name){
37
38  if (!Name.IsAscii())
39   Standard_ConstructionError::Raise("OSD_Printer::SetName");
40
41  myName = Name;
42 }
43
44
45 // -------------------------------------------------------------
46 // -------------------------------------------------------------
47 void OSD_Printer::Name (TCollection_AsciiString &Name)const{
48  Name = myName;
49 }
50
51
52 // -------------------------------------------------------------
53 // -------------------------------------------------------------
54 void OSD_Printer::Reset(){
55  myError.Reset();
56 }
57
58 // -------------------------------------------------------------
59 // -------------------------------------------------------------
60 Standard_Boolean OSD_Printer::Failed()const{
61  return( myError.Failed());
62 }
63
64 // -------------------------------------------------------------
65 // -------------------------------------------------------------
66 void OSD_Printer::Perror() {
67  myError.Perror();
68 }
69
70
71 // -------------------------------------------------------------
72 // -------------------------------------------------------------
73 Standard_Integer OSD_Printer::Error()const{
74  return( myError.Error());
75 }
76 #else
77
78 //------------------------------------------------------------------------
79 //-------------------  Windows NT sources for OSD_Printer ----------------
80 //------------------------------------------------------------------------
81
82 #include <OSD_OSDError.hxx>
83 #include <OSD_Printer.hxx>
84 #include <Standard_ConstructionError.hxx>
85 #include <Standard_NullObject.hxx>
86 #include <TCollection_AsciiString.hxx>
87
88 OSD_Printer :: OSD_Printer ( const TCollection_AsciiString& Name ) {
89
90  SetName ( Name );
91
92 }  // end constructor
93
94 void OSD_Printer :: SetName ( const TCollection_AsciiString& Name ) {
95
96  myName = Name;
97
98 }  // end OSD_Printer :: SetName
99
100 void OSD_Printer :: Name ( TCollection_AsciiString& Name ) const {
101
102  Name = myName;
103
104 }  // end OSD_Printer :: Name
105
106 Standard_Boolean OSD_Printer :: Failed () const {
107
108  return myError.Failed ();
109
110 }  // end OSD_Printer :: Failed
111
112 void OSD_Printer :: Reset () {
113
114  myError.Reset ();
115
116 }  // end OSD_Printer :: Reset
117
118 void OSD_Printer :: Perror () {
119
120  myError.Perror ();
121
122 }  // end OSD_Printer :: Perror
123
124 Standard_Integer OSD_Printer :: Error () const {
125
126  return myError.Error ();
127
128 }  // end OSD_Printer :: Error
129
130
131 #endif