LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MimeSystem Class Reference

#include <MimeSystem.h>

Classes

class  VerbInfo
 

Public Member Functions

std::string getActiveAppIdForResource (std::string mimeType)
 
int getAllAppIdForResource (std::string mimeType, std::string &r_active, std::vector< std::string > &r_handlerAppIds)
 
ResourceHandler getActiveHandlerForResource (std::string mimeType)
 
int getAllHandlersForResource (std::string mimeType, ResourceHandler &r_active, std::vector< ResourceHandler > &r_handlers)
 
std::string getActiveAppIdForRedirect (const std::string &url, bool doNotUseRegexpMatch, bool disallowSchemeForms)
 
int getAllAppIdForRedirect (const std::string &url, bool doNotUseRegexpMatch, std::string &r_active, std::vector< std::string > &r_handlerAppIds)
 
RedirectHandler getActiveHandlerForRedirect (const std::string &url, bool doNotUseRegexpMatch, bool disallowSchemeForms)
 
int getAllHandlersForRedirect (const std::string &url, bool doNotUseRegexpMatch, RedirectHandler &r_active, std::vector< RedirectHandler > &r_handlers)
 
std::string getAppIdByVerbForResource (std::string mimeType, const std::string &verb, std::string &r_params, uint32_t &r_index)
 
ResourceHandler getHandlerByVerbForResource (std::string mimeType, const std::string &verb)
 
int getAllHandlersByVerbForResource (std::string mimeType, const std::string &verb, std::vector< ResourceHandler > &r_handlers)
 
int getAllAppIdByVerbForResource (std::string mimeType, const std::string &verb, std::vector< VerbInfo > &r_handlers)
 
std::string getAppIdByVerbForRedirect (const std::string &url, bool disallowSchemeForms, const std::string &verb, std::string &r_params, uint32_t &r_index)
 
RedirectHandler getHandlerByVerbForRedirect (const std::string &url, bool disallowSchemeForms, const std::string &verb)
 
int getAllHandlersByVerbForRedirect (const std::string &url, const std::string &verb, std::vector< RedirectHandler > &r_handlers)
 
int getAllAppIdByVerbForRedirect (const std::string &url, const std::string &verb, std::vector< VerbInfo > &r_handlers)
 
RedirectHandler getRedirectHandlerDirect (const uint32_t index)
 
ResourceHandler getResourceHandlerDirect (const uint32_t index)
 
int removeAllForAppId (const std::string &appId)
 
int removeAllForMimeType (std::string mimeType)
 
int removeAllForUrl (const std::string &url)
 
int addResourceHandler (std::string &extension, std::string mimeType, bool shouldDownload, const std::string appId, const std::map< std::string, std::string > *pVerbs, bool sysDefault)
 
int addResourceHandler (std::string extension, bool shouldDownload, const std::string appId, const std::map< std::string, std::string > *pVerbs, bool sysDefault)
 
int addRedirectHandler (const std::string &url, const std::string appId, const std::map< std::string, std::string > *pVerbs, bool isSchemeForm, bool sysDefault)
 
int addVerbsToResourceHandler (std::string mimeType, const std::string &appId, const std::map< std::string, std::string > &verbs)
 
int addVerbsToRedirectHandler (const std::string &url, const std::string &appId, const std::map< std::string, std::string > &verbs)
 
int addVerbsDirect (uint32_t index, const std::map< std::string, std::string > &verbs)
 
int swapResourceHandler (std::string mimeType, uint32_t index)
 
int swapRedirectHandler (const std::string &url, uint32_t index)
 
bool getMimeTypeByExtension (std::string extension, std::string &r_mimeType)
 
std::string allTablesAsJsonString ()
 
std::string resourceTableAsJsonString ()
 
json_object * resourceTableAsJson ()
 
json_object * resourceTableAsJsonArray ()
 
std::string redirectTableAsJsonString ()
 
json_object * redirectTableAsJson ()
 
json_object * redirectTableAsJsonArray ()
 
std::string extensionMapAsJsonString ()
 
json_object * extensionMapAsJson ()
 
json_object * extensionMapAsJsonArray ()
 
bool saveMimeTable (const std::string &file, std::string &r_err)
 
bool saveMimeTableToActiveFile (std::string &r_err)
 
bool restoreMimeTable (const std::string &file, std::string &r_err)
 
bool restoreMimeTable (json_object *source, std::string &r_err)
 
bool clearMimeTable ()
 
bool dbg_printMimeTables ()
 
bool dbg_getResourceTableStrings (std::vector< std::pair< std::string, std::vector< std::string > > > &r_resourceTableStrings)
 
bool dbg_getRedirectTableStrings (std::vector< std::pair< std::string, std::vector< std::string > > > &r_redirectTableStrings)
 
void dbg_printVerbCacheTableForResource (const std::string &mime)
 
void dbg_printVerbCacheTableForRedirect (const std::string &url)
 
void dbg_printVerbCacheTableForScheme (const std::string &url)
 

Static Public Member Functions

static MimeSysteminstance ()
 
static MimeSysteminstance (const std::string &baseConfigFile)
 
static MimeSysteminstance (const std::string &baseConfigFile, const std::string &customizedConfigFile)
 
static bool getExtensionFromUrl (const std::string &url, std::string &r_extn)
 
static uint32_t assignIndex ()
 
static uint32_t getLastAssignedIndex ()
 
static std::string makePseudoExtensionFromMime (const std::string &mimeType)
 
static void deleteSavedMimeTable ()
 
static int extractVerbsFromHandlerEntryJson (struct json_object *jsonHandlerEntry, std::map< std::string, std::string > &r_verbs)
 
static int extractVerbsFromHandlerNodeEntryJson (struct json_object *jsonHandlerNodeEntry, std::map< std::string, uint32_t > &r_verbs)
 
static void dbg_printVerbCacheTable (const std::map< std::string, VerbCacheEntry > *p_verbCacheTable)
 
static void dbg_printResourceHandlerNode (const ResourceHandlerNode *p_resourceHandlerNode, int level=0)
 
static void dbg_printRedirectHandlerNode (const RedirectHandlerNode *p_redirectHandlerNode, int level=0)
 

Member Function Documentation

int MimeSystem::addRedirectHandler ( const std::string &  url,
const std::string  appId,
const std::map< std::string, std::string > *  pVerbs,
bool  isSchemeForm,
bool  sysDefault 
)
int MimeSystem::addResourceHandler ( std::string &  extension,
std::string  mimeType,
bool  shouldDownload,
const std::string  appId,
const std::map< std::string, std::string > *  pVerbs,
bool  sysDefault 
)

error

int MimeSystem::addResourceHandler ( std::string  extension,
bool  shouldDownload,
const std::string  appId,
const std::map< std::string, std::string > *  pVerbs,
bool  sysDefault 
)
int MimeSystem::addVerbsDirect ( uint32_t  index,
const std::map< std::string, std::string > &  verbs 
)
int MimeSystem::addVerbsToRedirectHandler ( const std::string &  url,
const std::string &  appId,
const std::map< std::string, std::string > &  verbs 
)
int MimeSystem::addVerbsToResourceHandler ( std::string  mimeType,
const std::string &  appId,
const std::map< std::string, std::string > &  verbs 
)
std::string MimeSystem::allTablesAsJsonString ( )
uint32_t MimeSystem::assignIndex ( )
static
bool MimeSystem::clearMimeTable ( )
bool MimeSystem::dbg_getRedirectTableStrings ( std::vector< std::pair< std::string, std::vector< std::string > > > &  r_redirectTableStrings)
bool MimeSystem::dbg_getResourceTableStrings ( std::vector< std::pair< std::string, std::vector< std::string > > > &  r_resourceTableStrings)
bool MimeSystem::dbg_printMimeTables ( )
void MimeSystem::dbg_printRedirectHandlerNode ( const RedirectHandlerNode *  p_redirectHandlerNode,
int  level = 0 
)
static
void MimeSystem::dbg_printResourceHandlerNode ( const ResourceHandlerNode *  p_resourceHandlerNode,
int  level = 0 
)
static
void MimeSystem::dbg_printVerbCacheTable ( const std::map< std::string, VerbCacheEntry > *  p_verbCacheTable)
static
void MimeSystem::dbg_printVerbCacheTableForRedirect ( const std::string &  url)
void MimeSystem::dbg_printVerbCacheTableForResource ( const std::string &  mime)
void MimeSystem::dbg_printVerbCacheTableForScheme ( const std::string &  url)
void MimeSystem::deleteSavedMimeTable ( )
static
json_object * MimeSystem::extensionMapAsJson ( )
json_object * MimeSystem::extensionMapAsJsonArray ( )
std::string MimeSystem::extensionMapAsJsonString ( )
int MimeSystem::extractVerbsFromHandlerEntryJson ( struct json_object *  jsonHandlerEntry,
std::map< std::string, std::string > &  r_verbs 
)
static
int MimeSystem::extractVerbsFromHandlerNodeEntryJson ( struct json_object *  jsonHandlerNodeEntry,
std::map< std::string, uint32_t > &  r_verbs 
)
static
std::string MimeSystem::getActiveAppIdForRedirect ( const std::string &  url,
bool  doNotUseRegexpMatch,
bool  disallowSchemeForms 
)
std::string MimeSystem::getActiveAppIdForResource ( std::string  mimeType)
RedirectHandler MimeSystem::getActiveHandlerForRedirect ( const std::string &  url,
bool  doNotUseRegexpMatch,
bool  disallowSchemeForms 
)
ResourceHandler MimeSystem::getActiveHandlerForResource ( std::string  mimeType)
int MimeSystem::getAllAppIdByVerbForRedirect ( const std::string &  url,
const std::string &  verb,
std::vector< VerbInfo > &  r_handlers 
)
int MimeSystem::getAllAppIdByVerbForResource ( std::string  mimeType,
const std::string &  verb,
std::vector< VerbInfo > &  r_handlers 
)
int MimeSystem::getAllAppIdForRedirect ( const std::string &  url,
bool  doNotUseRegexpMatch,
std::string &  r_active,
std::vector< std::string > &  r_handlerAppIds 
)
int MimeSystem::getAllAppIdForResource ( std::string  mimeType,
std::string &  r_active,
std::vector< std::string > &  r_handlerAppIds 
)
int MimeSystem::getAllHandlersByVerbForRedirect ( const std::string &  url,
const std::string &  verb,
std::vector< RedirectHandler > &  r_handlers 
)
int MimeSystem::getAllHandlersByVerbForResource ( std::string  mimeType,
const std::string &  verb,
std::vector< ResourceHandler > &  r_handlers 
)
int MimeSystem::getAllHandlersForRedirect ( const std::string &  url,
bool  doNotUseRegexpMatch,
RedirectHandler r_active,
std::vector< RedirectHandler > &  r_handlers 
)
int MimeSystem::getAllHandlersForResource ( std::string  mimeType,
ResourceHandler r_active,
std::vector< ResourceHandler > &  r_handlers 
)
std::string MimeSystem::getAppIdByVerbForRedirect ( const std::string &  url,
bool  disallowSchemeForms,
const std::string &  verb,
std::string &  r_params,
uint32_t &  r_index 
)
std::string MimeSystem::getAppIdByVerbForResource ( std::string  mimeType,
const std::string &  verb,
std::string &  r_params,
uint32_t &  r_index 
)
bool MimeSystem::getExtensionFromUrl ( const std::string &  url,
std::string &  r_extn 
)
static
RedirectHandler MimeSystem::getHandlerByVerbForRedirect ( const std::string &  url,
bool  disallowSchemeForms,
const std::string &  verb 
)
ResourceHandler MimeSystem::getHandlerByVerbForResource ( std::string  mimeType,
const std::string &  verb 
)
uint32_t MimeSystem::getLastAssignedIndex ( )
static
bool MimeSystem::getMimeTypeByExtension ( std::string  extension,
std::string &  r_mimeType 
)
RedirectHandler MimeSystem::getRedirectHandlerDirect ( const uint32_t  index)
ResourceHandler MimeSystem::getResourceHandlerDirect ( const uint32_t  index)
MimeSystem * MimeSystem::instance ( void  )
static
MimeSystem * MimeSystem::instance ( const std::string &  baseConfigFile)
static
MimeSystem * MimeSystem::instance ( const std::string &  baseConfigFile,
const std::string &  customizedConfigFile 
)
static
std::string MimeSystem::makePseudoExtensionFromMime ( const std::string &  mimeType)
static
json_object * MimeSystem::redirectTableAsJson ( )
json_object * MimeSystem::redirectTableAsJsonArray ( )
std::string MimeSystem::redirectTableAsJsonString ( )
int MimeSystem::removeAllForAppId ( const std::string &  appId)
int MimeSystem::removeAllForMimeType ( std::string  mimeType)
int MimeSystem::removeAllForUrl ( const std::string &  url)
json_object * MimeSystem::resourceTableAsJson ( )
json_object * MimeSystem::resourceTableAsJsonArray ( )
std::string MimeSystem::resourceTableAsJsonString ( )
bool MimeSystem::restoreMimeTable ( const std::string &  file,
std::string &  r_err 
)
bool MimeSystem::restoreMimeTable ( json_object *  source,
std::string &  r_err 
)
bool MimeSystem::saveMimeTable ( const std::string &  file,
std::string &  r_err 
)
bool MimeSystem::saveMimeTableToActiveFile ( std::string &  r_err)
int MimeSystem::swapRedirectHandler ( const std::string &  url,
uint32_t  index 
)
int MimeSystem::swapResourceHandler ( std::string  mimeType,
uint32_t  index 
)

The documentation for this class was generated from the following files: