]> Creatis software - gdcm.git/blob - src/gdcmCommand.cxx
Fix mistypings
[gdcm.git] / src / gdcmCommand.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmCommand.cxx,v $
5   Language:  C++
6   Date:      $Date: 2007/10/30 13:34:42 $
7   Version:   $Revision: 1.5 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 // ---------------------------------------------------------------
19 #include "gdcmCommand.h"
20
21 namespace GDCM_NAME_SPACE 
22 {
23 //-----------------------------------------------------------------------------
24 // Constructor / Destructor
25 /**
26  * \brief Constructor used when we want to generate dicom files from scratch
27  */
28 Command::Command()
29   :  Text(""), Object(NULL), ConstObject(NULL), Cmd(CMD_UNKNOWN)
30 {
31 //   Cmd = CMD_UNKNOWN;
32 //   Object = NULL;
33 //   ConstObject = NULL;
34 //   Text = "";
35 }
36
37
38 /**
39  * \brief   Canonical destructor.
40  */
41 Command::~Command ()
42 {
43 }
44
45 //-----------------------------------------------------------------------------
46 // Public
47 void Command::SetType(unsigned int type)
48 {
49    Cmd = type;
50 }
51
52 unsigned int Command::GetType() const
53 {
54    return Cmd;
55 }
56
57 void Command::SetObject(Base *object)
58 {
59    Object = object;
60 }
61
62 Base *Command::GetObject() const
63 {
64    return Object;
65 }
66
67 void Command::SetConstObject(const Base *object)
68 {
69    ConstObject = object;
70 }
71
72 const Base *Command::GetConstObject() const
73 {
74    if(ConstObject)
75       return ConstObject;
76    else
77       return GetObject();
78 }
79
80 void Command::SetText(const std::string &text)
81 {
82    Text = text;
83 }
84
85 const std::string &Command::GetText(void) const
86 {
87    return Text;
88 }
89
90 void Command::Execute()
91 {
92 }
93
94 const char *Command::GetCommandAsString(unsigned int command)
95 {
96    switch(command)
97    {
98       case CMD_UNKNOWN:
99          return "Unknown";
100       case CMD_DEBUG:
101          return "Debug";
102       case CMD_WARNING:
103          return "Warning";
104       case CMD_ERROR:
105          return "Error";
106       case CMD_ASSERT:
107          return "Assert";
108       case CMD_STARTPROGRESS:
109          return "StartProgress";
110       case CMD_ENDPROGRESS:
111          return "EndProgress";
112       case CMD_PROGRESS:
113          return "Progress";
114       default:
115          return "Undefined !!!";
116    }
117 }
118
119 //-----------------------------------------------------------------------------
120 // Protected
121
122 //-----------------------------------------------------------------------------
123 // Private
124
125 //-----------------------------------------------------------------------------
126 // Print
127
128 //-----------------------------------------------------------------------------
129 } // end namespace gdcm