Rhino C++ API
8.13
|
#include <opennurbs_string.h>
Public Member Functions | |
ON_NameHash ()=default | |
ON_NameHash (const ON_NameHash &)=default | |
~ON_NameHash ()=default | |
ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const |
32 bit hash of id and mapped name More... | |
ON__UINT32 | IdCRC (ON__UINT32 current_remainder) const |
32 bit hash of id More... | |
bool | IgnoreCase () const |
ON__UINT32 | Internal_DotNetInterfaceGetFlags () const |
bool | IsEmptyNameHash () const |
bool | IsFilePathHash () const |
bool | IsInvalidNameHash () const |
bool | IsValidAndNotEmpty () const |
ON__UINT32 | MappedNameCodePointCount () const |
ON_SHA1_Hash | MappedNameSha1Hash () const |
SHA-1 hash of mapped name. More... | |
ON__UINT32 | NameCRC (ON__UINT32 current_remainder) const |
32 bit hash of id and mapped name More... | |
ON_NameHash & | operator= (const ON_NameHash &)=default |
ON_UUID | ParentId () const |
Static Public Member Functions | |
static int | Compare (const ON_NameHash &a, const ON_NameHash &b) |
static int | CompareNameSHA1 (const ON_NameHash &a, const ON_NameHash &b) |
static int | CompareNameSHA1Ptr (const ON_NameHash *a, const ON_NameHash *b) |
static int | CompareParentId (const ON_NameHash &a, const ON_NameHash &b) |
static int | CompareParentIdPtr (const ON_NameHash *a, const ON_NameHash *b) |
static int | ComparePtr (const ON_NameHash *a, const ON_NameHash *b) |
static ON_NameHash | Create (const char *utf8_name) |
static ON_NameHash | Create (const char *utf8_name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_String &name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_String &utf8_name) |
static ON_NameHash | Create (const ON_UUID &parent_id, const char *utf8_name) |
static ON_NameHash | Create (const ON_UUID &parent_id, const char *utf8_name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_UUID &parent_id, const ON_String &name) |
static ON_NameHash | Create (const ON_UUID &parent_id, const ON_String &utf8_name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_UUID &parent_id, const ON_wString &name) |
static ON_NameHash | Create (const ON_UUID &parent_id, const ON_wString &name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_UUID &parent_id, const wchar_t *name) |
static ON_NameHash | Create (const ON_UUID &parent_id, const wchar_t *name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_UUID &parent_id, size_t length, const char *utf8_name) |
static ON_NameHash | Create (const ON_UUID &parent_id, size_t length, const char *utf8_name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_UUID &parent_id, size_t length, const wchar_t *name) |
static ON_NameHash | Create (const ON_UUID &parent_id, size_t length, const wchar_t *name, bool bIgnoreCase) |
static ON_NameHash | Create (const ON_wString &name) |
static ON_NameHash | Create (const ON_wString &name, bool bIgnoreCase) |
static ON_NameHash | Create (const wchar_t *name) |
static ON_NameHash | Create (const wchar_t *name, bool bIgnoreCase) |
static ON_NameHash | Create (size_t length, const char *utf8_name) |
static ON_NameHash | Create (size_t length, const char *utf8_name, bool bIgnoreCase) |
static ON_NameHash | Create (size_t length, const wchar_t *name) |
static ON_NameHash | Create (size_t length, const wchar_t *name, bool bIgnoreCase) |
static ON_NameHash | CreateFilePathHash (const char *file_path) |
static ON_NameHash | CreateFilePathHash (const class ON_FileReference &file_reference) |
static ON_NameHash | CreateFilePathHash (const wchar_t *file_path) |
static ON_NameHash | CreateIdAndEmptyName (const ON_UUID &parent_id) |
static ON_NameHash | CreateIdAndUnsetName (const ON_UUID &parent_id) |
static ON_NameHash | Internal_DotNetInterfaceSet (const ON_UUID &, const ON_SHA1_Hash &, const ON__UINT32) |
Static Public Attributes | |
static const ON_NameHash | EmptyNameHash |
static const ON_NameHash | UnsetNameHash |
Description: An ON_NameHash is designed to help search for and compare attribute names like the ON_ModelComponent.Name() value.
If a name is wchar_t encoded as wide_char_name and UTF-8 encoded as utf8_name, then ON_NameHash(wide_char_name) == ON_NameHash(utf8_name).
Set: bool bEqualNameHash = ON_NameHash::Create(parent_id1,name1) == ON_NameHash::Create(parent_id2,name2); bool bEqualParentId = (parent_id1 == parent_id2) bool bEqualAttributeName = ON_String::EqualAttributeName(name1,name2);
If (bEqualParentId && bEqualAttributeName) is true, then bEqualNameHash is true. If bEqualParentId is false, then bEqualNameHash is false. With probability 1-epsilon, if bEqualAttributeName is false, then bEqualNameHash is false, where epsilon is an extremely tiny number.
|
default |
Default construction creates ON_NameHash::UnsetNameHash.
|
default |
|
default |
|
static |
Description: Compares id, then length, then SHA-1 digest.
|
static |
|
static |
|
static |
|
static |
|
static |
Description: Compares id, then length, then SHA-1 digest.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns: ON_NameHash::EmptyNameHash if name is empty. ON_NameHash::UnsetNameHash if name is not valid.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
ON__UINT32 ON_NameHash::DataCRC | ( | ON__UINT32 | current_remainder | ) | const |
32 bit hash of id and mapped name
ON__UINT32 ON_NameHash::IdCRC | ( | ON__UINT32 | current_remainder | ) | const |
32 bit hash of id
bool ON_NameHash::IgnoreCase | ( | ) | const |
Returns: True if hash is set and case is ignored
ON__UINT32 ON_NameHash::Internal_DotNetInterfaceGetFlags | ( | ) | const |
|
static |
Description: Internal_CreateFromDotNet() is public for technical reasons. It is used in Rhino Common p-invoke code that provides a .NET interface to the services ON_NameHash provided by the ON_NameHash class. This function should be ignored and never called from ordinary C++ code. If you choose to ignore the preceding admonition, you will have to read the source code for information about how this function works.
bool ON_NameHash::IsEmptyNameHash | ( | ) | const |
Returns: True if the hash is for an empty name.
bool ON_NameHash::IsFilePathHash | ( | ) | const |
Returns: True if the hash is not empty and was set by calling CreateFilePathHash().
bool ON_NameHash::IsInvalidNameHash | ( | ) | const |
Returns: True if the hash is for an invalid name.
bool ON_NameHash::IsValidAndNotEmpty | ( | ) | const |
Returns: True if the hash is for a valid non-empty name.
ON__UINT32 ON_NameHash::MappedNameCodePointCount | ( | ) | const |
Number of UTf-32 code point values in mapped name. (0 for file path hashes)
ON_SHA1_Hash ON_NameHash::MappedNameSha1Hash | ( | ) | const |
SHA-1 hash of mapped name.
ON__UINT32 ON_NameHash::NameCRC | ( | ON__UINT32 | current_remainder | ) | const |
32 bit hash of id and mapped name
|
default |
ON_UUID ON_NameHash::ParentId | ( | ) | const |
|
static |
|
static |