Media Selector Data Model
[Content Management]


Detailed Description

Read and write the metadata catalog.


Data Structures

struct  alp_ms_dml_statement_parameters
 Structure that defines a query for the alp_ms_dml_statement api-s. (Use the alp_ms_dml_statement_parameters_* methods to set it.). More...

Defines

#define ALP_MS_DML_COL_ANY_FILEID   "file_id"
 int32 Identifier of file for metadata
#define ALP_MS_DML_COL_AUDIO_ALBUM   "album"
 string Album name
#define ALP_MS_DML_COL_AUDIO_ARTIST   "artist"
 string
#define ALP_MS_DML_COL_AUDIO_BITRATE   "bitrate"
 string
#define ALP_MS_DML_COL_AUDIO_COMPOSER   "composer"
 string
#define ALP_MS_DML_COL_AUDIO_COUNT   "play_count"
 int32 Number of times the file has been played
#define ALP_MS_DML_COL_AUDIO_CTIME   "ctime"
 int32 Creation time of file
#define ALP_MS_DML_COL_AUDIO_DURATION   "duration"
 int32 Duration in seconds of audio playback.
#define ALP_MS_DML_COL_AUDIO_GENRE   "genre"
 string
#define ALP_MS_DML_COL_AUDIO_NOTES   "notes"
 string
#define ALP_MS_DML_COL_AUDIO_PIC_PATH   "pic_file_location"
 string
#define ALP_MS_DML_COL_AUDIO_SAMPLERATE   "samplerate"
 string
#define ALP_MS_DML_COL_AUDIO_TITLE   "title"
 string Audio title
#define ALP_MS_DML_COL_AUDIO_TOTAL_TRACKS   "totaltracks"
 int32
#define ALP_MS_DML_COL_AUDIO_TRACKNUM   "tracknum"
 int32
#define ALP_MS_DML_COL_AUDIO_YEAR   "year"
 int32
#define ALP_MS_DML_COL_COLLECTION_COUNT   "count"
 int32
#define ALP_MS_DML_COL_COLLECTION_TITLE   "title"
 string
#define ALP_MS_DML_COL_DOCUMENT_DESCRIPTION   "title"
 string, (obsolete) document title
#define ALP_MS_DML_COL_DOCUMENT_NOTES   "notes"
 string
#define ALP_MS_DML_COL_DOCUMENT_TITLE   "title"
 string, document title
#define ALP_MS_DML_COL_DOCUMENT_TYPE   "mimetype"
 string Mimetype of document, useful for filters
#define ALP_MS_DML_COL_IMAGE_HEIGHT   "height"
 int32
#define ALP_MS_DML_COL_IMAGE_NOTES   "notes"
 string
#define ALP_MS_DML_COL_IMAGE_TITLE   "title"
 string
#define ALP_MS_DML_COL_IMAGE_WIDTH   "width"
 int32
#define ALP_MS_DML_COL_RINGTONE_DURATION   "duration"
 int32
#define ALP_MS_DML_COL_RINGTONE_TITLE   "title"
 string
#define ALP_MS_DML_COL_VIDEO_CREATION_TIME   "ctime"
 time_t Creation time of the video
#define ALP_MS_DML_COL_VIDEO_CTIME   "ctime"
 int32 Creation time of file
#define ALP_MS_DML_COL_VIDEO_DURATION   "duration"
 int32 Time in seconds of the video playback.
#define ALP_MS_DML_COL_VIDEO_GENRE   "genre"
 string
#define ALP_MS_DML_COL_VIDEO_HEIGHT   "height"
 int32 height of video frame
#define ALP_MS_DML_COL_VIDEO_NOTES   "notes"
 string
#define ALP_MS_DML_COL_VIDEO_PLAY_COUNT   "play_count"
 int32 Number of times the video has been played.
#define ALP_MS_DML_COL_VIDEO_TITLE   "title"
 string Title of the video.
#define ALP_MS_DML_COL_VIDEO_WIDTH   "width"
 int32 width of video frame
#define ALP_MS_DML_COL_VOICE_BITRATE   "bitrate"
 string
#define ALP_MS_DML_COL_VOICE_DURATION   "duration"
 int32
#define ALP_MS_DML_COL_VOICE_SAMPLERATE   "samplerate"
 string
#define ALP_MS_DML_COL_VOICE_TITLE   "title"
 string
#define ALP_MS_ITEM_TYPE_APPLICATION   ALP_MS_CATEGORY_APPLICATION
 The application category.
#define ALP_MS_ITEM_TYPE_AUDIO   ALP_MS_CATEGORY_AUDIO
 The audio category.
#define ALP_MS_ITEM_TYPE_AUDIO_PIC   ALP_MS_CATEGORY_AUDIO_PIC
 The audio pic category.
#define ALP_MS_ITEM_TYPE_DOCUMENT   ALP_MS_CATEGORY_APPLICATION
 Deprecated: the old document category
#define ALP_MS_ITEM_TYPE_IMAGE   ALP_MS_CATEGORY_IMAGE
 The image category.
#define ALP_MS_ITEM_TYPE_RINGTONE   ALP_MS_CATEGORY_RINGTONE
 The ringtone category.
#define ALP_MS_ITEM_TYPE_VIDEO   ALP_MS_CATEGORY_VIDEO
 The video category.
#define ALP_MS_ITEM_TYPE_VOICE   ALP_MS_CATEGORY_VOICE
 The voice category.

Typedefs

typedef int(* AlpMsCallbackFunction )(void *user_data, int argc, char **argv, char **azColName)
 Protoype for alp_ms_dml_statement_exec callback method. This callback should normally return 0; a non-zero value will terminate the query.

Enumerations

enum  alp_ms_dml_statement_exec_offsets { alp_ms_dml_statement_exec_location_offset = -2, alp_ms_dml_statement_exec_file_id_offset = -1 }
 Offsets to 'system fields' hidden by the alp_ms_dml_statement_exec callback. More...

Functions

alp_status_t alp_ms_dml_close (AlpDmlH dmlH)
 Close the MediaSelector DML when updating is complete.
alp_status_t alp_ms_dml_commit_item (AlpDmlH dmlH, AlpDmlItemH itemH)
 Commit the filled in metadata to the database.
alp_status_t alp_ms_dml_flush (AlpDmlH dmlH)
 Flush the MediaSelector DML transaction buffers.
alp_status_t alp_ms_dml_item_create (const char *item_type, AlpDmlItemH *itemH, const char *path)
 Create item metadata entry of a specified type.
alp_status_t alp_ms_dml_item_destroy (AlpDmlItemH itemH)
 Clean up after finished with an item.
alp_status_t alp_ms_dml_item_set_int32 (AlpDmlItemH itemH, const char *dml_column, int32_t *value)
 Sets integer value metadata.
alp_status_t alp_ms_dml_item_set_int64 (AlpDmlItemH itemH, const char *dml_column, int64_t *value)
 Sets integer value metadata.
alp_status_t alp_ms_dml_item_set_string (AlpDmlItemH itemH, const char *dml_column, const char *value)
 Sets string value metadata.
alp_status_t alp_ms_dml_open (AlpDmlH *dmlH)
 Open the MediaSelector DML for updating the data within.
alp_status_t alp_ms_dml_statement_begin (AlpDmlH dmlH, AlpDmlStatementH *stmtH, alp_ms_dml_statement_parameters *params, int *numResults)
 Begin dml statment using the given criteria.
alp_status_t alp_ms_dml_statement_build_single_file_filter (const char *filename, char **filter)
 Generate a filter to select a single file. (Looks up file_id and dir_id.).
alp_status_t alp_ms_dml_statement_end (AlpDmlStatementH stmtH)
 Close statement handle.
alp_status_t alp_ms_dml_statement_exec (AlpDmlH dmlH, AlpMsCallbackFunction callback, void *data, alp_ms_dml_statement_parameters *params, int *numResults)
 Run dml statment using the given criteria, and call callback method once per row.
alp_status_t alp_ms_dml_statement_get_columns (AlpDmlStatementH stmtH, int *columnCount, gchar ***columnNames)
 Get the list of column names - useful when fields=="*".
alp_status_t alp_ms_dml_statement_get_file_url (AlpDmlStatementH stmtH, const char **url)
 Get a file URL for current row. This may be used in conjunction with alp_mf_get_url_path() to get a path to the file. Caller owns the returned string, and must free it with g_free!
alp_status_t alp_ms_dml_statement_get_int32 (AlpDmlStatementH stmtH, const char *dml_column, int32_t *value)
 Get an int32_t from column by name.
alp_status_t alp_ms_dml_statement_get_int64 (AlpDmlStatementH stmtH, const char *dml_column, int64_t *value)
 Get an int64_t from column by name.
alp_status_t alp_ms_dml_statement_get_string (AlpDmlStatementH stmtH, const char *dml_column, const char **value)
 Get a string from column by name. Caller does NOT own string, and should not free it!
alp_status_t alp_ms_dml_statement_next (AlpDmlStatementH stmtH)
 Advance to the next statement.
alp_status_t alp_ms_dml_statement_parameters_clear (alp_ms_dml_statement_parameters *parameters)
 Initialize parameters block - set all fields to default values (binary zero).
alp_status_t alp_ms_dml_statement_parameters_set_fields (alp_ms_dml_statement_parameters *parameters, const char *category, const char *fields)
 Set both category and fields.
alp_status_t alp_ms_dml_statement_parameters_set_match (alp_ms_dml_statement_parameters *parameters, const char *matchField, const char *match)
 Set both match and matchField.
alp_status_t alp_ms_dml_statement_parameters_set_regex (alp_ms_dml_statement_parameters *parameters, const char *regexField, const char *regex)
 Set both regex and regexField - slow but powerful matching.
alp_status_t alp_ms_dml_statement_parameters_set_select_by_category (alp_ms_dml_statement_parameters *parameters, const char *includedCategories, const char *excludedCategories)
 Set both includedCategories and excludedCategories.
alp_status_t alp_ms_dml_statement_parameters_set_skip (alp_ms_dml_statement_parameters *parameters, int start, int limit)
 Set start/limit - restrict results to a 'window'.
alp_status_t alp_ms_dml_statement_parameters_set_sort (alp_ms_dml_statement_parameters *parameters, const char *sortby, bool ascending)
 Set sort info.


Define Documentation

#define ALP_MS_DML_COL_ANY_FILEID   "file_id"
 

int32 Identifier of file for metadata

#define ALP_MS_DML_COL_AUDIO_ALBUM   "album"
 

string Album name

#define ALP_MS_DML_COL_AUDIO_ARTIST   "artist"
 

string

#define ALP_MS_DML_COL_AUDIO_BITRATE   "bitrate"
 

string

#define ALP_MS_DML_COL_AUDIO_COMPOSER   "composer"
 

string

#define ALP_MS_DML_COL_AUDIO_COUNT   "play_count"
 

int32 Number of times the file has been played

#define ALP_MS_DML_COL_AUDIO_CTIME   "ctime"
 

int32 Creation time of file

#define ALP_MS_DML_COL_AUDIO_DURATION   "duration"
 

int32 Duration in seconds of audio playback.

#define ALP_MS_DML_COL_AUDIO_GENRE   "genre"
 

string

#define ALP_MS_DML_COL_AUDIO_NOTES   "notes"
 

string

#define ALP_MS_DML_COL_AUDIO_PIC_PATH   "pic_file_location"
 

string

#define ALP_MS_DML_COL_AUDIO_SAMPLERATE   "samplerate"
 

string

#define ALP_MS_DML_COL_AUDIO_TITLE   "title"
 

string Audio title

#define ALP_MS_DML_COL_AUDIO_TOTAL_TRACKS   "totaltracks"
 

int32

#define ALP_MS_DML_COL_AUDIO_TRACKNUM   "tracknum"
 

int32

#define ALP_MS_DML_COL_AUDIO_YEAR   "year"
 

int32

#define ALP_MS_DML_COL_COLLECTION_COUNT   "count"
 

int32

#define ALP_MS_DML_COL_COLLECTION_TITLE   "title"
 

string

#define ALP_MS_DML_COL_DOCUMENT_DESCRIPTION   "title"
 

string, (obsolete) document title

#define ALP_MS_DML_COL_DOCUMENT_NOTES   "notes"
 

string

#define ALP_MS_DML_COL_DOCUMENT_TITLE   "title"
 

string, document title

#define ALP_MS_DML_COL_DOCUMENT_TYPE   "mimetype"
 

string Mimetype of document, useful for filters

#define ALP_MS_DML_COL_IMAGE_HEIGHT   "height"
 

int32

#define ALP_MS_DML_COL_IMAGE_NOTES   "notes"
 

string

#define ALP_MS_DML_COL_IMAGE_TITLE   "title"
 

string

#define ALP_MS_DML_COL_IMAGE_WIDTH   "width"
 

int32

#define ALP_MS_DML_COL_RINGTONE_DURATION   "duration"
 

int32

#define ALP_MS_DML_COL_RINGTONE_TITLE   "title"
 

string

#define ALP_MS_DML_COL_VIDEO_CREATION_TIME   "ctime"
 

time_t Creation time of the video

#define ALP_MS_DML_COL_VIDEO_CTIME   "ctime"
 

int32 Creation time of file

#define ALP_MS_DML_COL_VIDEO_DURATION   "duration"
 

int32 Time in seconds of the video playback.

#define ALP_MS_DML_COL_VIDEO_GENRE   "genre"
 

string

#define ALP_MS_DML_COL_VIDEO_HEIGHT   "height"
 

int32 height of video frame

#define ALP_MS_DML_COL_VIDEO_NOTES   "notes"
 

string

#define ALP_MS_DML_COL_VIDEO_PLAY_COUNT   "play_count"
 

int32 Number of times the video has been played.

#define ALP_MS_DML_COL_VIDEO_TITLE   "title"
 

string Title of the video.

#define ALP_MS_DML_COL_VIDEO_WIDTH   "width"
 

int32 width of video frame

#define ALP_MS_DML_COL_VOICE_BITRATE   "bitrate"
 

string

#define ALP_MS_DML_COL_VOICE_DURATION   "duration"
 

int32

#define ALP_MS_DML_COL_VOICE_SAMPLERATE   "samplerate"
 

string

#define ALP_MS_DML_COL_VOICE_TITLE   "title"
 

string

#define ALP_MS_ITEM_TYPE_APPLICATION   ALP_MS_CATEGORY_APPLICATION
 

The application category.

#define ALP_MS_ITEM_TYPE_AUDIO   ALP_MS_CATEGORY_AUDIO
 

The audio category.

#define ALP_MS_ITEM_TYPE_AUDIO_PIC   ALP_MS_CATEGORY_AUDIO_PIC
 

The audio pic category.

#define ALP_MS_ITEM_TYPE_DOCUMENT   ALP_MS_CATEGORY_APPLICATION
 

Deprecated: the old document category

#define ALP_MS_ITEM_TYPE_IMAGE   ALP_MS_CATEGORY_IMAGE
 

The image category.

#define ALP_MS_ITEM_TYPE_RINGTONE   ALP_MS_CATEGORY_RINGTONE
 

The ringtone category.

#define ALP_MS_ITEM_TYPE_VIDEO   ALP_MS_CATEGORY_VIDEO
 

The video category.

#define ALP_MS_ITEM_TYPE_VOICE   ALP_MS_CATEGORY_VOICE
 

The voice category.


Typedef Documentation

typedef int(* AlpMsCallbackFunction)(void *user_data, int argc, char **argv, char **azColName)
 

Protoype for alp_ms_dml_statement_exec callback method. This callback should normally return 0; a non-zero value will terminate the query.

Parameters:
[in] user_data An arbitrary pointer, passed to alp_ms_dml_statement_exec()
[in] argc The number of strings in argv and azColName
[in] argv An array of strings, one per field
[in] azColName The field names


Enumeration Type Documentation

enum alp_ms_dml_statement_exec_offsets
 

Offsets to 'system fields' hidden by the alp_ms_dml_statement_exec callback.

Enumerator:
alp_ms_dml_statement_exec_location_offset  database index. 0 is device, 1 is card.
alp_ms_dml_statement_exec_file_id_offset  the file number


Function Documentation

alp_status_t alp_ms_dml_close AlpDmlH  dmlH  ) 
 

Close the MediaSelector DML when updating is complete.

Parameters:
[in] dmlH The handle as filled in by alp_ms_dml_open().
Returns:
ALP_STATUS_OK on success.

alp_status_t alp_ms_dml_commit_item AlpDmlH  dmlH,
AlpDmlItemH  itemH
 

Commit the filled in metadata to the database.

Parameters:
[in] dmlH The handle to the MediaSelector DML.
[in] itemH the handle to the item as filled in by alp_ms_dml_item_create().
Returns:
ALP_STATUS_OK on success.

ALP_STATUS_MS_DML_BAD_PARAM if the itemH is invalid.

ALP_STATUS_MS_DML_DATABASE_ERR if there is a database error.

Note:
The DML system caches commits, and they will not actually be written to disk until one of three things happens:
  1. You close the DML handle with alp_ms_dml_close();
  2. You flush the cache with alp_ms_dml_flush(); or
  3. The cache exceeds internal limits and is auto-flushed.
In practice, this should only affect you if you use an AlpDmlH to write, and then try to read your writes.

alp_status_t alp_ms_dml_flush AlpDmlH  dmlH  ) 
 

Flush the MediaSelector DML transaction buffers.

Parameters:
[in] dmlH The handle as filled in by alp_ms_dml_open().
Returns:
ALP_STATUS_OK on success.

alp_status_t alp_ms_dml_item_create const char *  item_type,
AlpDmlItemH itemH,
const char *  path
 

Create item metadata entry of a specified type.

Parameters:
[in] item_type Specifies the type of item to create, use one of the ALP_MS_ITEM_TYPE_* constants.
[out] itemH A pointer to an item handle to be filled out.
[in] path The full path to the file which has the specified metadata. Please note
  1. File must already be indexed.
  2. The path must be a 'true' path such as you get from the Linux realpath function. This function may fail if you use a symlink (such as /media) instead of a 'true' path (such as /tmp/media).
Returns:
ALP_STATUS_OK on success.

ALP_STATUS_MS_DML_BAD_PARAM if the type parameter is not recognized.

ALP_STATUS_MS_DML_NOT_INDEXED if the file is not in the database

Note:
*itemH will be NULL on an error return

alp_status_t alp_ms_dml_item_destroy AlpDmlItemH  itemH  ) 
 

Clean up after finished with an item.

Parameters:
[in] itemH The handle to the item to clean up (as filled in by alp_ms_dml_item_create().
Returns:
ALP_STATUS_OK, always.

alp_status_t alp_ms_dml_item_set_int32 AlpDmlItemH  itemH,
const char *  dml_column,
int32_t *  value
 

Sets integer value metadata.

Parameters:
[in] itemH The handle to the item.
[in] dml_column The column id for the metadata, use one of the ALP_MS_DML_COL_* constants that match the ALP_MS_ITEM_TYPE_* specified on creation.
[in] value The value to set, if NULL, the value will be considered 'unset' explicity.
Returns:
ALP_STATUS_MS_OK on success.

ALP_STATUS_MS_DML_BAD_PARAM if itemH is not valid.

ALP_STATUS_MS_DML_COLUMN_INVALID if the column parameter is invalid for the item type.

ALP_STATUS_MS_DML_COLUMN_MISMATCH if the value type is wrong for the column type.

ALP_STATUS_MS_DML_SYSTEM_COLUMN if you may not use the dml_item API to set this column

alp_status_t alp_ms_dml_item_set_int64 AlpDmlItemH  itemH,
const char *  dml_column,
int64_t *  value
 

Sets integer value metadata.

Parameters:
[in] itemH The handle to the item.
[in] dml_column The column id for the metadata, use one of the ALP_MS_DML_COL_* constants that match the ALP_MS_ITEM_TYPE_* specified on creation.
[in] value The value to set, if NULL, the value will be considered 'unset' explicity.
Returns:
ALP_STATUS_MS_OK on success.

ALP_STATUS_MS_DML_BAD_PARAM if itemH is not valid.

ALP_STATUS_MS_DML_COLUMN_INVALID if the column parameter is invalid for the item type.

ALP_STATUS_MS_DML_COLUMN_MISMATCH if the value type is wrong for the column type.

ALP_STATUS_MS_DML_SYSTEM_COLUMN if you may not use the dml_item API to set this column

alp_status_t alp_ms_dml_item_set_string AlpDmlItemH  itemH,
const char *  dml_column,
const char *  value
 

Sets string value metadata.

Parameters:
[in] itemH The handle to the item.
[in] dml_column The column id for the metadata, use one of the ALP_MS_DML_COL_* constants that match the ALP_MS_ITEM_TYPE_* specified on creation.n.
[in] value The value to set, if NULL, the value will be considered 'unset' explicity.
Returns:
ALP_STATUS_MS_OK on success.

ALP_STATUS_MS_DML_BAD_PARAM if itemH is not valid.

ALP_STATUS_MS_DML_COLUMN_INVALID if the column parameter is invalid for the item type.

ALP_STATUS_MS_DML_COLUMN_MISMATCH if the value type is wrong for the column type.

alp_status_t alp_ms_dml_open AlpDmlH dmlH  ) 
 

Open the MediaSelector DML for updating the data within.

Parameters:
[out] dmlH Address of an AlpDmlH to be filled when opened.
Returns:
ALP_STATUS_OK on success.

alp_status_t alp_ms_dml_statement_begin AlpDmlH  dmlH,
AlpDmlStatementH stmtH,
alp_ms_dml_statement_parameters params,
int *  numResults
 

Begin dml statment using the given criteria.

Parameters:
[in] dmlH The DML handle, as filled in by alp_ms_dml_open().
[out] stmtH The statement handle
[in] params A populated params block that describes the search statement
[out] numResults If not NULL, provides number of rows that will be returned by search
Returns:
ALP_STATUS_OK Success

ALP_STATUS_MS_DML_INTERNAL_ERR Couldn't create a statement

alp_status_t alp_ms_dml_statement_build_single_file_filter const char *  filename,
char **  filter
 

Generate a filter to select a single file. (Looks up file_id and dir_id.).

Parameters:
[in] filename The filename that you want to retrieve metadata for
[out] filter A alp_ms_dml_statement_parameters.filter string. Caller owns returned string, and must call g_free when done with it.
Note:
Setup category and fields as for any other dml_statement query, then call alp_ms_dml_statement_exec() or alp_ms_dml_statement_begin() / alp_ms_dml_statement_next() / alp_ms_dml_statement_end().

alp_status_t alp_ms_dml_statement_end AlpDmlStatementH  stmtH  ) 
 

Close statement handle.

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_exec AlpDmlH  dmlH,
AlpMsCallbackFunction  callback,
void *  data,
alp_ms_dml_statement_parameters params,
int *  numResults
 

Run dml statment using the given criteria, and call callback method once per row.

Parameters:
[in] dmlH The handle, as filled in by alp_ms_dml_open().
[in] callback If NULL, method will only return numResults
[in] data Arbitrary user data, passed to callback
[in] params A populated params block that describes the search statement
[out] numResults If not NULL, provides number of rows that will be returned by search
Returns:
ALP_STATUS_OK Success - all result records presented to callback

ALP_STATUS_MS_DML_BAD_PARAM Invalid params block - couldn't create a SQL statement

ALP_STATUS_SAL_ABORT Callback returned a non-zero value and aborted the enumeration

alp_status_t alp_ms_dml_statement_get_columns AlpDmlStatementH  stmtH,
int *  columnCount,
gchar ***  columnNames
 

Get the list of column names - useful when fields=="*".

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
[out] columnCount The number of columns - may be NULL
[out] columnNames An array of column name strings - may be NULL
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_get_file_url AlpDmlStatementH  stmtH,
const char **  url
 

Get a file URL for current row. This may be used in conjunction with alp_mf_get_url_path() to get a path to the file. Caller owns the returned string, and must free it with g_free!

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
[out] url The file URL

alp_status_t alp_ms_dml_statement_get_int32 AlpDmlStatementH  stmtH,
const char *  dml_column,
int32_t *  value
 

Get an int32_t from column by name.

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
[in] dml_column The column name
[out] value The column value
Returns:
ALP_STATUS_OK Success

ALP_STATUS_MS_DML_BAD_PARAM Either dml_column or value are NULL

ALP_STATUS_MS_DML_COLUMN_INVALID Column name not in result set

ALP_STATUS_MS_DML_NOT_A_NUMBER Result is not a number

ALP_STATUS_MS_DML_OUT_OF_RANGE Result won't fit in an int32

alp_status_t alp_ms_dml_statement_get_int64 AlpDmlStatementH  stmtH,
const char *  dml_column,
int64_t *  value
 

Get an int64_t from column by name.

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
[in] dml_column The column name
[out] value The column value
Returns:
ALP_STATUS_OK Success

ALP_STATUS_MS_DML_BAD_PARAM Either dml_column or value are NULL

ALP_STATUS_MS_DML_COLUMN_INVALID Column name not in result set

ALP_STATUS_MS_DML_NOT_A_NUMBER Result is not a number

alp_status_t alp_ms_dml_statement_get_string AlpDmlStatementH  stmtH,
const char *  dml_column,
const char **  value
 

Get a string from column by name. Caller does NOT own string, and should not free it!

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
[in] dml_column The column name
[out] value The column value
Returns:
ALP_STATUS_OK Success

ALP_STATUS_MS_DML_BAD_PARAM Either dml_column or value are NULL

ALP_STATUS_MS_DML_COLUMN_INVALID Column name not in result set

alp_status_t alp_ms_dml_statement_next AlpDmlStatementH  stmtH  ) 
 

Advance to the next statement.

Parameters:
[in] stmtH The statement handle, as set by alp_ms_dml_statement_begin()
Returns:
ALP_STATUS_OK There is data to be read with the alp_ms_dml_statement_get_X methods

ALP_STATUS_SAL_NORECORDS No matches, or no more matches

alp_status_t alp_ms_dml_statement_parameters_clear alp_ms_dml_statement_parameters parameters  ) 
 

Initialize parameters block - set all fields to default values (binary zero).

Parameters:
[in,out] parameters The parameter block to clear
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_fields alp_ms_dml_statement_parameters parameters,
const char *  category,
const char *  fields
 

Set both category and fields.

Parameters:
[in,out] parameters The parameter block to set
[in] category A comma-separated list of categories to get data from
[in] fields A comma-separated list of fields. (You can use qualified names like file.name)
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_match alp_ms_dml_statement_parameters parameters,
const char *  matchField,
const char *  match
 

Set both match and matchField.

Parameters:
[in,out] parameters The parameter block to set
[in] matchField The field to match against
[in] match Flexible matching, e.g. "sai" to match "sailing". _ matches any 1 character and % matches 0-or-more of any character. (\ escapes _ and %.)
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_regex alp_ms_dml_statement_parameters parameters,
const char *  regexField,
const char *  regex
 

Set both regex and regexField - slow but powerful matching.

Parameters:
[in,out] parameters The parameter block to set
[in] regexField Field to apply regex to match against
[in] regex POSIX regex (case insensitive, extended)
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_select_by_category alp_ms_dml_statement_parameters parameters,
const char *  includedCategories,
const char *  excludedCategories
 

Set both includedCategories and excludedCategories.

Parameters:
[in,out] parameters The parameter block to set
[in] includedCategories A comma-separated list of categories that a file is in. For example, "audio" would give you all audio files.
[in] excludedCategories A comma-separated list of categories that you don't want to see. For example, including "audio" while excluding "voice,ringtones" will give you all audio files that are neither voice or ringtone files.
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_skip alp_ms_dml_statement_parameters parameters,
int  start,
int  limit
 

Set start/limit - restrict results to a 'window'.

Parameters:
[in,out] parameters The parameter block to set
[in] start Records to skip: 0..n-1
[in] limit Limit number of records returned (0 means no limit)
Returns:
ALP_STATUS_OK This method can not fail

alp_status_t alp_ms_dml_statement_parameters_set_sort alp_ms_dml_statement_parameters parameters,
const char *  sortby,
bool  ascending
 

Set sort info.

Parameters:
[in,out] parameters The parameter block to set
[in] sortby "size", "artist", "audio.title", etc. NULL means no sorting.
[in] ascending Ascending or descending result
Returns:
ALP_STATUS_OK This method can not fail


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.