* InstalledTypes did not preserve the case of the MIME types, and thus, Tracker queries
for some types (like "application/x-vnd.Be-elfexecutable") would fail. This fixes bug #666 (no, I'm not the exorcist :-)). * Renamed private methods to have the '_' prefix. * Cleanup, added license. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17832 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file InstalledTypes.h
|
||||
InstalledTypes class declarations
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2002-2006, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Tyler Dauwalder
|
||||
* Ingo Weinhold, [email protected]
|
||||
* Axel Dörfler, [email protected]
|
||||
*/
|
||||
#ifndef _MIME_INSTALLED_TYPES_H
|
||||
#define _MIME_INSTALLED_TYPES_H
|
||||
|
||||
|
||||
#include <mime/Supertype.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
@@ -23,37 +24,39 @@ namespace Storage {
|
||||
namespace Mime {
|
||||
|
||||
class InstalledTypes {
|
||||
public:
|
||||
InstalledTypes();
|
||||
~InstalledTypes();
|
||||
|
||||
status_t GetInstalledTypes(BMessage *types);
|
||||
status_t GetInstalledTypes(const char *supertype, BMessage *types);
|
||||
status_t GetInstalledSupertypes(BMessage *types);
|
||||
public:
|
||||
InstalledTypes();
|
||||
~InstalledTypes();
|
||||
|
||||
status_t AddType(const char *type);
|
||||
status_t RemoveType(const char *type);
|
||||
private:
|
||||
status_t AddSupertype(const char *super, std::map<std::string, Supertype>::iterator &i);
|
||||
status_t AddSubtype(const char *super, const char *sub);
|
||||
status_t AddSubtype(Supertype &super, const char *sub);
|
||||
|
||||
status_t RemoveSupertype(const char *super);
|
||||
status_t RemoveSubtype(const char *super, const char *sub);
|
||||
status_t GetInstalledTypes(BMessage *types);
|
||||
status_t GetInstalledTypes(const char *supertype, BMessage *types);
|
||||
status_t GetInstalledSupertypes(BMessage *types);
|
||||
|
||||
void Unset();
|
||||
void ClearCachedMessages();
|
||||
status_t AddType(const char *type);
|
||||
status_t RemoveType(const char *type);
|
||||
|
||||
status_t CreateMessageWithTypes(BMessage **result) const;
|
||||
status_t CreateMessageWithSupertypes(BMessage **result) const;
|
||||
void FillMessageWithSupertypes(BMessage *msg);
|
||||
|
||||
status_t BuildInstalledTypesList();
|
||||
private:
|
||||
status_t _AddSupertype(const char *super,
|
||||
std::map<std::string, Supertype>::iterator &i);
|
||||
status_t _AddSubtype(const char *super, const char *sub);
|
||||
status_t _AddSubtype(Supertype &super, const char *sub);
|
||||
|
||||
std::map<std::string, Supertype> fSupertypes;
|
||||
BMessage *fCachedMessage;
|
||||
BMessage *fCachedSupertypesMessage;
|
||||
bool fHaveDoneFullBuild;
|
||||
status_t _RemoveSupertype(const char *super);
|
||||
status_t _RemoveSubtype(const char *super, const char *sub);
|
||||
|
||||
void _Unset();
|
||||
void _ClearCachedMessages();
|
||||
|
||||
status_t _CreateMessageWithTypes(BMessage **result) const;
|
||||
status_t _CreateMessageWithSupertypes(BMessage **result) const;
|
||||
void _FillMessageWithSupertypes(BMessage *msg);
|
||||
|
||||
status_t _BuildInstalledTypesList();
|
||||
|
||||
std::map<std::string, Supertype> fSupertypes;
|
||||
BMessage *fCachedMessage;
|
||||
BMessage *fCachedSupertypesMessage;
|
||||
bool fHaveDoneFullBuild;
|
||||
};
|
||||
|
||||
} // namespace Mime
|
||||
|
||||
Reference in New Issue
Block a user