0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / IGESSelect / IGESSelect_UpdateCreationDate.cxx
1 // Copyright (c) 1999-2014 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 //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000)
15 #include <IGESSelect_UpdateCreationDate.ixx>
16 #include <OSD_Process.hxx>
17 #include <Quantity_Date.hxx>
18 #include <IGESData_GlobalSection.hxx>
19 #include <TCollection_HAsciiString.hxx>
20 #include <Interface_Check.hxx>
21
22
23
24 IGESSelect_UpdateCreationDate::IGESSelect_UpdateCreationDate ()
25     : IGESSelect_ModelModifier (Standard_False)    {  }
26
27     void  IGESSelect_UpdateCreationDate::Performing
28   (IFSelect_ContextModif& ctx,
29    const Handle(IGESData_IGESModel)& target,
30    Interface_CopyTool& ) const
31 {
32   Standard_Integer jour,mois,annee,heure,minute,seconde,millisec,microsec;
33   OSD_Process system;
34   Quantity_Date ladate = system.SystemDate();
35   ladate.Values (mois,jour,annee,heure,minute,seconde,millisec,microsec);
36
37   IGESData_GlobalSection GS = target->GlobalSection();
38   if (annee < 2000)
39      //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
40     GS.SetDate (IGESData_GlobalSection::NewDateString
41                 (annee,mois,jour,heure,minute,seconde,0));
42   else 
43     //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
44     GS.SetDate (IGESData_GlobalSection::NewDateString
45                 (annee,mois,jour,heure,minute,seconde, -1));
46   target->SetGlobalSection(GS);
47   Handle(Interface_Check) check = new Interface_Check;
48   target->VerifyCheck(check);
49   ctx.AddCheck(check);
50 }
51
52
53     TCollection_AsciiString  IGESSelect_UpdateCreationDate::Label () const
54 { return TCollection_AsciiString ("Update Creation Date in IGES Global Section"); }