mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-23 23:06:26 +08:00
Add source code for rhino 6.8 release
This commit is contained in:
390
opennurbs_version_number.h
Normal file
390
opennurbs_version_number.h
Normal file
@@ -0,0 +1,390 @@
|
||||
/* $NoKeywords: $ */
|
||||
/*
|
||||
//
|
||||
// Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
|
||||
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
|
||||
// McNeel & Associates.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
|
||||
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
|
||||
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
|
||||
//
|
||||
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
#if !defined(OPENNURBS_VERSION_NUMBER_INC_)
|
||||
#define OPENNURBS_VERSION_NUMBER_INC_
|
||||
|
||||
/*
|
||||
Description:
|
||||
Create a 4-byte unsigned integer value that has desireable version
|
||||
number properties.
|
||||
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
major_version >= 0 and major_version <= 63
|
||||
|
||||
minor_version - [in]
|
||||
minor_version >= 0 and minor_version <= 127
|
||||
|
||||
year - [in]
|
||||
year >= 2000 and year <= 2099
|
||||
|
||||
month - [in]
|
||||
month >= 1 and month <= 12
|
||||
|
||||
day_of_month - [in]
|
||||
day_of_month >= 1 and day_of_month <= ON_DaysInMonthOfGregorianYear(year,month)
|
||||
|
||||
branch - [in]
|
||||
>= 0 and <= 3
|
||||
0 = developer build
|
||||
1 = build system trunk branch build
|
||||
2 = build system release candidate branch build
|
||||
3 = build system release build
|
||||
|
||||
Returns:
|
||||
If the input values are valid, this returns
|
||||
a 4-byte nonzero version number with the following properties:
|
||||
verA = ON_VersionNumberConstruct(majorA,minorA,<timeA>,branchA)
|
||||
verB = ON_VersionNumberConstruct(majorB,minorB,<timeB>,branchB)
|
||||
- If majorA > majorB, then verA > verB.
|
||||
- If majorA = majorB and minorA > minorB, then verA > verB.
|
||||
- If majorA = majorB and minorA = minorB and
|
||||
timeA > timeB, then verA > verB.
|
||||
- If majorA = majorB, minorA = minorB, timeA = timeB, and
|
||||
branchA > branchB, then verA > verB.
|
||||
If any input is not valid, then zero is returned.
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_VersionNumberConstruct(
|
||||
unsigned int major_version,
|
||||
unsigned int minor_version,
|
||||
unsigned int year,
|
||||
unsigned int month,
|
||||
unsigned int day_of_month,
|
||||
unsigned int branch
|
||||
);
|
||||
|
||||
/*
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
major_version >= 0 and major_version <= 63
|
||||
|
||||
Returns:
|
||||
The smallest possible non-zero version number
|
||||
ON_VersionNumberConstruct() will create
|
||||
for a specified major version with valid input.
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_VersionNumberMinimum(
|
||||
unsigned int major_version
|
||||
);
|
||||
|
||||
/*
|
||||
Returns:
|
||||
True if the version_number is a value created by
|
||||
ON_VersionNumberConstruct().
|
||||
Parameters:
|
||||
version_number - [in]
|
||||
*/
|
||||
ON_DECL
|
||||
bool ON_VersionNumberIsValid(
|
||||
unsigned int version_number
|
||||
);
|
||||
|
||||
/*
|
||||
Parameters:
|
||||
archive_3dm_version - [in]
|
||||
If the context of the query is a version number from
|
||||
an ON_BinaryArchive, then pass the value
|
||||
of ON_BinaryArchive.Archive3dmVersion() here.
|
||||
version_number - [in]
|
||||
version number to test.
|
||||
Returns:
|
||||
True if the version number is in the
|
||||
YYYYMMDDn format used by version 1,2,3,4,5
|
||||
of opennurbs and the Rhino SDK.
|
||||
*/
|
||||
ON_DECL
|
||||
bool ON_VersionNumberIsYearMonthDateFormat(
|
||||
unsigned int archive_3dm_version,
|
||||
unsigned int version_number
|
||||
);
|
||||
|
||||
/*
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
>= 0 and < 64
|
||||
Returns:
|
||||
The smallest possible non-zero version number
|
||||
ON_VersionNumberConstruct() will create
|
||||
for a specified major version with valid input.
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_VersionNumberFromYearMonthDateFormat(
|
||||
unsigned int major_version,
|
||||
unsigned int yyyy_mm_dd_n_version_number
|
||||
);
|
||||
|
||||
/*
|
||||
Description:
|
||||
Parse a version number created by ON_VersionNumberConstruct() to
|
||||
recover the input parameters.
|
||||
Parameters:
|
||||
version_number - [in]
|
||||
A version number created with ON_VersionNumberConstruct().
|
||||
|
||||
version_major - [out]
|
||||
version_major >= 0 and version_major <= 63
|
||||
|
||||
version_minor - [out]
|
||||
version_minor >= 0 and version_minor <= 127
|
||||
|
||||
version_year - [out]
|
||||
version_year >= 2000 and version_year <= 2099
|
||||
|
||||
version_month - [out]
|
||||
version_month >= 1 and version_month <= 12
|
||||
|
||||
version_day_of_month - [out]
|
||||
version_day_of_month >= 1 and version_day_of_month <= ON_DaysInMonthOfGregorianYear(year,month)
|
||||
|
||||
version_branch - [out]
|
||||
version_branch >= 0 and version_branch <= 3
|
||||
0: developer build
|
||||
1: build system trunk branch build
|
||||
2: build system release candidate build
|
||||
3: build system release build
|
||||
|
||||
Remarks:
|
||||
Any output parameter pointer may be null if you do not want that
|
||||
information.
|
||||
|
||||
Returns:
|
||||
true:
|
||||
The version_number parameter is a valid version number.
|
||||
All output parameters are set.
|
||||
false:
|
||||
The version_number parameter is not a valid version number.
|
||||
All output parameters are set to zero.
|
||||
*/
|
||||
ON_DECL
|
||||
bool ON_VersionNumberParse(
|
||||
unsigned int version_number,
|
||||
unsigned int* version_major,
|
||||
unsigned int* version_minor,
|
||||
unsigned int* version_year,
|
||||
unsigned int* version_month,
|
||||
unsigned int* version_day_of_month,
|
||||
unsigned int* version_branch
|
||||
);
|
||||
|
||||
ON_DECL
|
||||
const ON_String ON_VersionNumberToString(
|
||||
unsigned int version_number,
|
||||
bool bUnsignedFormat,
|
||||
bool bDateFormat
|
||||
);
|
||||
|
||||
ON_DECL
|
||||
const ON_wString ON_VersionNumberToWideString(
|
||||
unsigned int version_number,
|
||||
bool bUnsignedFormat,
|
||||
bool bDateFormat
|
||||
);
|
||||
|
||||
ON_DECL
|
||||
const ON_String ON_SdkVersionNumberToString(
|
||||
unsigned int sdk_version_number,
|
||||
unsigned int sdk_service_release_number
|
||||
);
|
||||
|
||||
ON_DECL
|
||||
const ON_wString ON_SdkVersionNumberToWideString(
|
||||
unsigned int sdk_version_number,
|
||||
unsigned int sdk_service_release_number
|
||||
);
|
||||
|
||||
/*
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
major_version >= 0 and major_version <= 63
|
||||
|
||||
minor_version - [in]
|
||||
minor_version >= 0 and minor_version <= 127
|
||||
|
||||
year - [in]
|
||||
year >= 2000 and year <= 2099
|
||||
|
||||
month - [in]
|
||||
month >= 1 and month <= 12
|
||||
|
||||
day_of_month - [in]
|
||||
day_of_month >= 1 and day_of_month <= ON_DaysInMonthOfGregorianYear(year,month)
|
||||
|
||||
hour - [in]
|
||||
hour >= 0 and hour <= 23
|
||||
|
||||
minute - [in]
|
||||
minute >= 0 and minute <= 59
|
||||
|
||||
branch - [in]
|
||||
branch >= 0 and branch <= 3
|
||||
0: developer build
|
||||
1: build system trunk branch build
|
||||
2: build system release candidate build
|
||||
3: build system release build
|
||||
|
||||
quartet_values - [out]
|
||||
quartet_values[0] = major_version
|
||||
quartet_values[1] = minor_version
|
||||
quartet_values[2] = (year-2000)*1000 + ON_DayOfGregorianYear(year,month,day_of_month)
|
||||
quartet_values[3] = hour*1000 + minute*100 + branch
|
||||
|
||||
Returns:
|
||||
0: failure because input is not valid
|
||||
>0: value of ON_VersionNumberConstruct(major_version,minor_version,year,month,day_of_month,branch)
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_GetVersionQuartet(
|
||||
unsigned int major_version,
|
||||
unsigned int minor_version,
|
||||
unsigned int year,
|
||||
unsigned int month,
|
||||
unsigned int day_of_month,
|
||||
unsigned int hour,
|
||||
unsigned int minute,
|
||||
unsigned int branch,
|
||||
unsigned short quartet_values[4]
|
||||
);
|
||||
|
||||
/*
|
||||
Description:
|
||||
Get a null terminated string that describes the version information
|
||||
as "major.,minor.yyddd.hhmmb".
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
major_version >= 0 and major_version <= 63
|
||||
|
||||
minor_version - [in]
|
||||
minor_version >= 0 and minor_version <= 127
|
||||
|
||||
year - [in]
|
||||
year >= 2000 and year <= 2099
|
||||
|
||||
month - [in]
|
||||
month >= 1 and month <= 12
|
||||
|
||||
day_of_month - [in]
|
||||
day_of_month >= 1 and day_of_month <= ON_DaysInMonthOfGregorianYear(year,month)
|
||||
|
||||
hour - [in]
|
||||
hour >= 0 and hour <= 23
|
||||
|
||||
minute - [in]
|
||||
minute >= 0 and minute <= 59
|
||||
|
||||
branch - [in]
|
||||
branch >= 0 and branch <= 3
|
||||
0: developer build
|
||||
1: build system trunk branch build
|
||||
2: build system release candidate build
|
||||
3: build system release build
|
||||
|
||||
string_buffer_capacity - [in]
|
||||
Number of available char elements in string_buffer[]
|
||||
|
||||
string_buffer - [out]
|
||||
If 0 == string_buffer_capacity or nullptr == string_buffer,
|
||||
then the number of char elements in the version number as a string, not including a null terminator,
|
||||
is returned and no changes are made to string_buffer.
|
||||
|
||||
If string_buffer_capacity > 0 && nullptr != string_buffer,
|
||||
then the version number as a string is returned in string_buffer.
|
||||
All string_buffer[] elements after the version number string are set to zero.
|
||||
(This is a safe and secure string function.)
|
||||
Returns:
|
||||
0: failure because input is not valid
|
||||
>0: The number of char elements, not including a null terminator, in the version number as a string.
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_GetVersionString(
|
||||
unsigned int major_version,
|
||||
unsigned int minor_version,
|
||||
unsigned int year,
|
||||
unsigned int month,
|
||||
unsigned int day_of_month,
|
||||
unsigned int hour,
|
||||
unsigned int minute,
|
||||
unsigned int branch,
|
||||
size_t string_buffer_capacity,
|
||||
char* string_buffer
|
||||
);
|
||||
|
||||
/*
|
||||
Description:
|
||||
Get a null terminated wide character string that describes the version information
|
||||
as "major.minor.yyddd.hhmmb".
|
||||
Parameters:
|
||||
major_version - [in]
|
||||
major_version >= 0 and major_version <= 63
|
||||
|
||||
minor_version - [in]
|
||||
minor_version >= 0 and minor_version <= 127
|
||||
|
||||
year - [in]
|
||||
year >= 2000 and year <= 2099
|
||||
|
||||
month - [in]
|
||||
month >= 1 and month <= 12
|
||||
|
||||
day_of_month - [in]
|
||||
day_of_month >= 1 and day_of_month <= ON_DaysInMonthOfGregorianYear(year,month)
|
||||
|
||||
hour - [in]
|
||||
hour >= 0 and hour <= 23
|
||||
|
||||
minute - [in]
|
||||
minute >= 0 and minute <= 59
|
||||
|
||||
branch - [in]
|
||||
branch >= 0 and branch <= 3
|
||||
0: developer build
|
||||
1: build system trunk branch build
|
||||
2: build system release candidate build
|
||||
3: build system release build
|
||||
|
||||
string_buffer_capacity - [in]
|
||||
Number of available char elements in string_buffer[]
|
||||
|
||||
string_buffer - [out]
|
||||
If 0 == string_buffer_capacity or nullptr == string_buffer,
|
||||
then the number of wchar_t elements in the version number as a string, not including a null terminator,
|
||||
is returned and no changes are made to string_buffer.
|
||||
|
||||
If string_buffer_capacity > 0 && nullptr != string_buffer,
|
||||
then the version number as a string is returned in string_buffer.
|
||||
All string_buffer[] elements after the version number string are set to zero.
|
||||
(This is a safe and secure string function.)
|
||||
Returns:
|
||||
0: failure because input is not valid
|
||||
>0: The number of char elements, not including a null terminator, in the version number as a string.
|
||||
*/
|
||||
ON_DECL
|
||||
unsigned int ON_GetVersionWideString(
|
||||
unsigned int major_version,
|
||||
unsigned int minor_version,
|
||||
unsigned int year,
|
||||
unsigned int month,
|
||||
unsigned int day_of_month,
|
||||
unsigned int hour,
|
||||
unsigned int minute,
|
||||
unsigned int branch,
|
||||
size_t string_buffer_capacity,
|
||||
wchar_t* string_buffer
|
||||
);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user