Truxton subject tag

From truxwiki.com
Jump to navigation Jump to search

This will tag the suspect. It will cause a record to be created in the [Tagged] table.

Syntax

int truxton_subject_tag( uint64_t subject_handle, char const * tag_name, char const * why, uint64_t origin );

Parameters

subject_handle

The handle to the subject object. This comes from calling truxton_subject_create().

tag_name

The small bit of text that will serve as the tag. This will show up in the user interface. This parameter must match one of the values in the [Name] column of the [Tag] table. You can create tags using the truxton_create_tag API.

why

The reason why this item was tagged.

origin

What produced this tag. If an algorithm produced this tag, it should be set to 1. If you are calling this method because a human told you to, the value should be 2.

Return value

A non-zero value on success, zero on failure.

Sample

void create_villan( uint64_t truxton )
{
   uint64_t subject = truxton_subject_create( truxton );

   truxton_subject_set_name( subject, "Khaka Peü Peü" );
   truxton_subject_set_description( subject, "Last name translates to 'This strong hand or that strong hand.'" );
   truxton_subject_set_custom( subject, "Danville PD Tri-State ID: TSA-785543" );
   truxton_subject_set_birthday( subject, to_ticks( "1963-09-18" ) );
   truxton_subject_set_id( subject, "5068696E-6561-7320-616E-642046657262" );
   truxton_subject_set_picture( subject, base64_encode( "C:\Subjects\Photos\KPP.png" ) );

   // Commit the data to the database
   truxton_subject_save( subject );

   truxton_subject_tag( subject, "Prime Suspect", "As identified by The Beak", TAG_ORIGIN_HUMAN );
   truxton_subject_destroy( subject );
}