> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Title Storage blob 메타데이터 가져오기

> 결과 핸들을 통한 페이징을 포함하여 XblTitleStorageGetBlobMetadataAsync로 XBOX Title Storage blob 메타데이터를 검색하기 위한 flat C 코드 예제입니다.

이 항목에서는 다음 flat C 코드 예제를 사용하여 XBOX Title Storage에서 blob 메타데이터를 검색하는 방법을 보여줍니다.

#### Flat C

```cpp theme={null}
auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->context = nullptr;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock };
    XblTitleStorageBlobMetadataResultHandle handle;
    HRESULT hr = XblTitleStorageGetBlobMetadataResult(asyncBlock, &handle);

    if (SUCCEEDED(hr))
    {
        if (blobMetadataResultHandle != nullptr)
        {
            XblTitleStorageBlobMetadataResultCloseHandle(blobMetadataResultHandle);
        }

        blobMetadataResultHandle = handle;
    }

};

HRESULT hr = XblTitleStorageGetBlobMetadataAsync(
    xboxLiveContext,
    scid,
    storageType,
    blobPath.c_str(),
    xboxUserId,
    skipItems,
    maxItems,
    asyncBlock.get()
);

if (SUCCEEDED(hr))
{
    asyncBlock.release();
}
```

## XblTitleStorageBlobMetadata 객체의 한 페이지만 존재합니다

다음 코드 예제는 `XblTitleStorageBlobMetadataResultHandle`을 사용하여 [XblTitleStorageBlobMetadata](/reference/live/xsapi-c/title_storage_c/structs/xbltitlestorageblobmetadata) 객체 목록의 첫 번째 페이지를 검색하는 방법을 보여줍니다.
<Note>타이틀이 Title Storage에 가지고 있는 blob 수에 따라 여러 페이지의 `XblTitleStorageBlobMetadata`가 있을 수 있습니다.</Note>

#### Flat C

```cpp theme={null}
XblTitleStorageBlobMetadataResultHandle handle = blobMetadataResultHandle;

const XblTitleStorageBlobMetadata* items;
size_t itemsSize;

HRESULT hr = XblTitleStorageBlobMetadataResultGetItems(handle, &items, &itemsSize);
```

## XblTitleStorageBlobMetadata 객체의 추가 페이지가 존재하는지 확인

다음 코드 예제는 Title Storage에서 검색할 `XblTitleStorageBlobMetadata`의 추가 페이지가 있는지 확인하는 방법을 보여줍니다.

#### Flat C

```cpp theme={null}
XblTitleStorageBlobMetadataResultHandle handle = blobMetadataResultHandle;

bool hasNext;

HRESULT hr = XblTitleStorageBlobMetadataResultHasNext(handle, &hasNext);
```

## XblTitleStorageBlobMetadata 객체의 추가 페이지 검색

다음 코드 예제는 `XblTitleStorageBlobMetadata` 객체의 다음 페이지를 검색하는 방법을 보여줍니다.

#### Flat C

```cpp theme={null}
XblTitleStorageBlobMetadataResultHandle handle = blobMetadataResultHandle;

auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->context = nullptr;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock };
    XblTitleStorageBlobMetadataResultHandle handle{ nullptr };
    
    HRESULT hr = XblTitleStorageBlobMetadataResultGetNextResult(asyncBlock, &handle);
};

HRESULT hr = XblTitleStorageBlobMetadataResultGetNextAsync(handle, maxItems, asyncBlock.get());

if (SUCCEEDED(hr))
{
    asyncBlock.release();
}
```

## XblTitleStorageBlobMetadataResultHandle 복제

다음 코드 예제는 `XblTitleStorageBlobMetadataResultHandle`의 복제본을 만드는 방법을 보여줍니다.

#### Flat C

```cpp theme={null}
XblTitleStorageBlobMetadataResultHandle handle = blobMetadataResultHandle;
XblTitleStorageBlobMetadataResultHandle duplicatedHandle;

HRESULT hr = XblTitleStorageBlobMetadataResultDuplicateHandle(handle, &duplicatedHandle);
```

## XblTitleStorageBlobMetadataResultHandle 닫기

다음 코드 예제는 `XblTitleStorageBlobMetadataResultHandle`을 닫는 방법을 보여줍니다.

<Note>이 핸들 사용을 마쳤을 때 반드시 닫아야 합니다.</Note>

#### Flat C

```cpp theme={null}
XblTitleStorageBlobMetadataResultHandle handle = blobMetadataResultHandle;
XblTitleStorageBlobMetadataResultCloseHandle(handle);
blobMetadataResultHandle = nullptr;
```

## 참고 항목

[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)

[XblTitleStorageBlobMetadataResultCloseHandle](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresultclosehandle)

[XblTitleStorageGetBlobMetadataAsync](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetblobmetadataasync)

[XblTitleStorageGetBlobMetadataResult](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetblobmetadataresult)

[XblTitleStorageBlobMetadata](/reference/live/xsapi-c/title_storage_c/structs/xbltitlestorageblobmetadata)

[XblTitleStorageBlobMetadataResultGetItems](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresultgetitems)

[XblTitleStorageBlobMetadataResultHasNext](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresulthasnext)

[XblTitleStorageBlobMetadataResultGetNextAsync](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresultgetnextasync)

[XblTitleStorageBlobMetadataResultGetNextResult](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresultgetnextresult)

[XblTitleStorageBlobMetadataResultDuplicateHandle](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestorageblobmetadataresultduplicatehandle)
