mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
0023483: Use appropriate type for handling integer time
Introduced new cdl-friendly Standard_Time alias to time_t type.
This commit is contained in:
parent
5edb1ac35b
commit
6c3e4c2965
@ -128,7 +128,7 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer from Standard ;
|
thetime : Time from Standard;
|
||||||
thesequenceoffuzzydefinitions : SequenceOfFuzzyDefinitions from Dynamic;
|
thesequenceoffuzzydefinitions : SequenceOfFuzzyDefinitions from Dynamic;
|
||||||
|
|
||||||
end FuzzyDefinitionsDictionary;
|
end FuzzyDefinitionsDictionary;
|
||||||
|
@ -136,7 +136,7 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer from Standard ;
|
thetime : Time from Standard;
|
||||||
thesequenceofmethoddefinitions : SequenceOfMethodDefinitions from Dynamic;
|
thesequenceofmethoddefinitions : SequenceOfMethodDefinitions from Dynamic;
|
||||||
|
|
||||||
end MethodDefinitionsDictionary;
|
end MethodDefinitionsDictionary;
|
||||||
|
@ -85,7 +85,7 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer from Standard;
|
thetime : Time from Standard;
|
||||||
thematerialssequence : MaterialsSequence from Materials;
|
thematerialssequence : MaterialsSequence from Materials;
|
||||||
|
|
||||||
end MaterialsDictionary;
|
end MaterialsDictionary;
|
||||||
|
@ -49,6 +49,8 @@ Standard_ShortReal.cxx
|
|||||||
Standard_ShortReal.hxx
|
Standard_ShortReal.hxx
|
||||||
Standard_Stream.hxx
|
Standard_Stream.hxx
|
||||||
Standard_String.hxx
|
Standard_String.hxx
|
||||||
|
Standard_Time.cxx
|
||||||
|
Standard_Time.hxx
|
||||||
Standard_Transient.hxx
|
Standard_Transient.hxx
|
||||||
Standard_Transient_proto.hxx
|
Standard_Transient_proto.hxx
|
||||||
Standard_TypeDef.hxx
|
Standard_TypeDef.hxx
|
||||||
|
@ -80,7 +80,7 @@ is
|
|||||||
primitive Byte inherits Storable;
|
primitive Byte inherits Storable;
|
||||||
primitive Real inherits Storable;
|
primitive Real inherits Storable;
|
||||||
primitive ShortReal inherits Storable;
|
primitive ShortReal inherits Storable;
|
||||||
|
primitive Time inherits Storable;
|
||||||
primitive OId inherits Storable;
|
primitive OId inherits Storable;
|
||||||
|
|
||||||
deferred class Persistent ; -- inherits Storable
|
deferred class Persistent ; -- inherits Storable
|
||||||
|
27
src/Standard/Standard_Time.cxx
Normal file
27
src/Standard/Standard_Time.cxx
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (c) 2013 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#include <Standard_Time.hxx>
|
||||||
|
#include <Standard_ConstructionError.hxx>
|
||||||
|
|
||||||
|
const Handle_Standard_Type& Standard_Time_Type_()
|
||||||
|
{
|
||||||
|
static Handle_Standard_Type _aType =
|
||||||
|
new Standard_Type ("Standard_Time", sizeof(Standard_Time), 0, NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
43
src/Standard/Standard_Time.hxx
Normal file
43
src/Standard/Standard_Time.hxx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright (c) 2013 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#ifndef _Standard_Time_HeaderFile
|
||||||
|
#define _Standard_Time_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeDef_HeaderFile
|
||||||
|
#include <Standard_TypeDef.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class Handle_Standard_Type;
|
||||||
|
|
||||||
|
__Standard_API const Handle_Standard_Type& Standard_Time_Type_();
|
||||||
|
|
||||||
|
// ===============================================
|
||||||
|
// Methods from Standard_Entity class which are redefined:
|
||||||
|
// - IsEqual
|
||||||
|
// ===============================================
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// IsEqual : Returns Standard_True if two time values are equal
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
inline Standard_Boolean IsEqual (const Standard_Time theOne,
|
||||||
|
const Standard_Time theTwo)
|
||||||
|
{
|
||||||
|
return theOne == theTwo;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -21,6 +21,7 @@
|
|||||||
#define _Standard_TypeDef_HeaderFile
|
#define _Standard_TypeDef_HeaderFile
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
#define Standard_False (Standard_Boolean)0
|
#define Standard_False (Standard_Boolean)0
|
||||||
#define Standard_True (Standard_Boolean)1
|
#define Standard_True (Standard_Boolean)1
|
||||||
@ -42,5 +43,6 @@ typedef size_t Standard_Size;
|
|||||||
typedef const char* Standard_CString;
|
typedef const char* Standard_CString;
|
||||||
typedef const short* Standard_ExtString;
|
typedef const short* Standard_ExtString;
|
||||||
|
|
||||||
#endif
|
typedef std::time_t Standard_Time;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -105,7 +105,7 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer;
|
thetime : Time from Standard;
|
||||||
thesequenceoftokens : TokensSequence from Units;
|
thesequenceoftokens : TokensSequence from Units;
|
||||||
|
|
||||||
end Lexicon;
|
end Lexicon;
|
||||||
|
@ -111,7 +111,7 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer;
|
thetime : Time from Standard;
|
||||||
thequantitiessequence : QuantitiesSequence from Units;
|
thequantitiessequence : QuantitiesSequence from Units;
|
||||||
|
|
||||||
end UnitsDictionary;
|
end UnitsDictionary;
|
||||||
|
@ -110,7 +110,7 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename)
|
|||||||
thefilename = new TCollection_HAsciiString(afilename);
|
thefilename = new TCollection_HAsciiString(afilename);
|
||||||
|
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if(!stat(afilename,&buf)) thetime = (Standard_Integer)buf.st_ctime;
|
if(!stat(afilename,&buf)) thetime = buf.st_ctime;
|
||||||
|
|
||||||
thequantitiessequence = new Units_QuantitiesSequence();
|
thequantitiessequence = new Units_QuantitiesSequence();
|
||||||
|
|
||||||
|
@ -85,6 +85,6 @@ is
|
|||||||
fields
|
fields
|
||||||
|
|
||||||
thefilename : HAsciiString from TCollection;
|
thefilename : HAsciiString from TCollection;
|
||||||
thetime : Integer;
|
thetime : Time from Standard;
|
||||||
|
|
||||||
end UnitsLexicon;
|
end UnitsLexicon;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user