haiku/src/servers/media/MMediaFilesManager.h
Jérôme Duval 4691dc7ff8 MediaFiles support added
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-11-12 10:24:42 +00:00

60 lines
1.2 KiB
C++

/*
* Copyright 2003, Jérôme Duval. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include <Entry.h>
#include <File.h>
#include <Locker.h>
#include <String.h>
#include "TMap.h"
#include "DataExchange.h"
class MMediaFilesManager
{
public:
MMediaFilesManager();
~MMediaFilesManager();
status_t LoadState();
status_t SaveState();
void Dump();
status_t RewindTypes(
BString ***types,
int32 *count);
status_t RewindRefs(
const char * type,
BString ***items,
int32 *count);
status_t GetRefFor(
const char * type,
const char * item,
entry_ref ** out_ref);
status_t SetRefFor(
const char * type,
const char * item,
const entry_ref & ref);
status_t RemoveRefFor( // This might better be called "ClearRefFor"
const char * type, // but it's too late now...
const char * item,
const entry_ref & ref);
status_t RemoveItem( // new in 4.1, removes the whole item.
const char * type,
const char * item);
private:
static int32 ReadPascalString(BFile &file, char **str);
static int32 WritePascalString(BFile &file, const char *str);
private:
BLocker *fLocker;
Map<BString, Map<BString, entry_ref> > * fRegistryMap;
uint32 header[3];
};