Blender  V3.3
Namespaces | Functions
uuid.cc File Reference
#include "BLI_assert.h"
#include "BLI_uuid.h"
#include <cstdio>
#include <cstring>
#include <ctime>
#include <random>
#include <sstream>
#include <string>
#include <tuple>

Go to the source code of this file.

Namespaces

 blender
 

Functions

bUUID BLI_uuid_generate_random ()
 
bUUID BLI_uuid_nil ()
 
bool BLI_uuid_is_nil (bUUID uuid)
 
bool BLI_uuid_equal (const bUUID uuid1, const bUUID uuid2)
 
void BLI_uuid_format (char *buffer, const bUUID uuid)
 
bool BLI_uuid_parse_string (bUUID *uuid, const char *buffer)
 
std::ostream & operator<< (std::ostream &stream, bUUID uuid)
 
bool blender::operator== (const bUUID uuid1, const bUUID uuid2)
 
bool blender::operator!= (const bUUID uuid1, const bUUID uuid2)
 
bool blender::operator< (const bUUID uuid1, const bUUID uuid2)
 

Function Documentation

◆ BLI_uuid_equal()

bool BLI_uuid_equal ( bUUID  uuid1,
bUUID  uuid2 
)

Compare two UUIDs, return true only if they are equal.

Definition at line 81 of file uuid.cc.

Referenced by BLI_uuid_is_nil(), file_set_asset_catalog_filter_settings(), blender::operator==(), and blender::bke::tests::TEST().

◆ BLI_uuid_format()

void BLI_uuid_format ( char *  buffer,
bUUID  uuid 
)

Format UUID as string. The buffer must be at least 37 bytes (36 bytes for the UUID + terminating 0). Use UUID_STRING_LEN from DNA_uuid_types.h if you want to use a constant for this.

Definition at line 86 of file uuid.cc.

References buffer, bUUID::clock_seq_hi_and_reserved, bUUID::clock_seq_low, bUUID::node, bUUID::time_hi_and_version, bUUID::time_low, and bUUID::time_mid.

Referenced by blender::ed::asset::index::AssetEntryWriter::add_catalog_id(), blender::ed::asset_browser::AssetCatalogTreeViewItem::build_context_menu(), operator<<(), and blender::tests::TEST().

◆ BLI_uuid_generate_random()

bUUID BLI_uuid_generate_random ( void  )

UUID generator for random (version 4) UUIDs. See RFC4122 section 4.4. This function is not thread-safe.

Definition at line 21 of file uuid.cc.

References bUUID::clock_seq_hi_and_reserved, max, min, seed, and bUUID::time_hi_and_version.

Referenced by blender::bke::AssetCatalog::from_path(), blender::bke::tests::TEST(), blender::tests::TEST(), and blender::bke::tests::TEST_F().

◆ BLI_uuid_is_nil()

bool BLI_uuid_is_nil ( bUUID  uuid)

◆ BLI_uuid_nil()

bUUID BLI_uuid_nil ( void  )

Return the UUID nil value, consisting of all-zero fields.

Definition at line 70 of file uuid.cc.

Referenced by BKE_asset_metadata_catalog_id_clear(), BLI_uuid_is_nil(), blender::tests::TEST(), and blender::bke::tests::TEST_F().

◆ BLI_uuid_parse_string()

bool BLI_uuid_parse_string ( bUUID uuid,
const char *  buffer 
)

Parse a string as UUID. The string MUST be in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, as produced by BLI_uuid_format().

Return true if the string could be parsed, and false otherwise. In the latter case, the UUID may have been partially updated.

Definition at line 103 of file uuid.cc.

References buffer, bUUID::clock_seq_hi_and_reserved, bUUID::clock_seq_low, bUUID::node, bUUID::time_hi_and_version, bUUID::time_low, and bUUID::time_mid.

Referenced by asset_catalog_delete_exec(), blender::bke::AssetCatalogDefinitionFile::parse_catalog_line(), and blender::tests::TEST().

◆ operator<<()

std::ostream& operator<< ( std::ostream &  stream,
bUUID  uuid 
)

Definition at line 122 of file uuid.cc.

References BLI_uuid_format(), and buffer.