mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@651 385bec56-5757-e545-9c3a-d8741f4650f1
83 lines
2.1 KiB
C++
83 lines
2.1 KiB
C++
// IDB.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
|
|
//
|
|
|
|
#include "IDB.h"
|
|
#include "IDBi.h"
|
|
#include <nn/assert.h>
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
// 関数定義
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 初期化
|
|
void IDB_Initialize( u8 *buffer, bool onMemory, bool readOnly )
|
|
{
|
|
NN_NULL_ASSERT( buffer );
|
|
if ( buffer==NULL ) return;
|
|
|
|
IDBi_Initialize( buffer, onMemory, readOnly);
|
|
}
|
|
|
|
// 開放
|
|
u8 * IDB_Finalize( void )
|
|
{
|
|
return IDBi_Finalize();
|
|
}
|
|
|
|
// 必要なバッファサイズを返す
|
|
u32 IDB_GetBufferSize( bool onMemory )
|
|
{
|
|
return IDBi_GetBufferSize(onMemory);
|
|
}
|
|
|
|
BOOL IDB_IsInitialized( void )
|
|
{
|
|
return IDBi_IsInitialized();
|
|
}
|
|
|
|
// 指定したアイコン情報をフレンド枠に追加する
|
|
// 追加したindexを返す
|
|
// データが追加できなかったときはFALSEを返す
|
|
BOOL IDB_Update( IDB_Icon *inIcon )
|
|
{
|
|
NN_NULL_ASSERT( inIcon );
|
|
if ( inIcon==NULL ) return FALSE;
|
|
|
|
return IDBi_Update( inIcon, IDBi_DIVISION_FRIEND ) != IDBi_INDEX_INVALID;
|
|
}
|
|
|
|
// 指定したキーを持つアイコンデータをロードする
|
|
// データが存在しない場合はfalseを返す
|
|
BOOL IDB_Select( IDB_Icon *outIcon, IDB_Key *key )
|
|
{
|
|
NN_NULL_ASSERT( outIcon );
|
|
NN_NULL_ASSERT( key );
|
|
|
|
if ( outIcon==NULL ) return FALSE;
|
|
if ( key==NULL ) return FALSE;
|
|
|
|
return IDBi_Select(outIcon, key, TRUE);
|
|
}
|
|
|
|
// 指定したインデックスを持つアイコンデータをロードする
|
|
// データが存在しない場合はfalseを返す
|
|
BOOL IDB_SelectFromIndex( IDB_Icon *outIcon, IDBi_Index index )
|
|
{
|
|
NN_NULL_ASSERT( outIcon );
|
|
|
|
if ( outIcon==NULL ) return FALSE;
|
|
|
|
return IDBi_SelectFromIndex(outIcon, index, TRUE);
|
|
}
|
|
|
|
// 指定したキーのデータが存在するかどうかを返す
|
|
// データが存在したらtrue、存在しない場合はfalseを返す
|
|
BOOL IDB_IsContains( IDB_Key *key )
|
|
{
|
|
NN_NULL_ASSERT( key );
|
|
|
|
if ( key==NULL ) return FALSE;
|
|
|
|
return IDBi_IsContains( key );
|
|
}
|