upnpcommonutils.cpp File Reference

const TLitC< sizeof(L"upnputilities.txt")/2 > KComponentLogfile

const TLitC < sizeof(L"upnputilities.txt")/2 > KComponentLogfile [static]

const TLitC8< sizeof("audio")> KMimeAudio

const TLitC8 < sizeof("audio")> KMimeAudio [static]

const TLitC8< sizeof("video")> KMimeVideo

const TLitC8 < sizeof("video")> KMimeVideo [static]

const TLitC8< sizeof("image")> KMimeImage

const TLitC8 < sizeof("image")> KMimeImage [static]

const TLitC8< sizeof("audio/mpegurl")> KMimePlaylist

const TLitC8 < sizeof("audio/mpegurl")> KMimePlaylist [static]

const TLitC16< sizeof(L".XHTML")/2 > KXHtml16

const TLitC16 < sizeof(L".XHTML")/2 > KXHtml16 [static]

const TLitC16< sizeof(L".HTML")/2 > KHtml16

const TLitC16 < sizeof(L".HTML")/2 > KHtml16 [static]

const TLitC16< sizeof(L".XML")/2 > KXml16

const TLitC16 < sizeof(L".XML")/2 > KXml16 [static]

const TLitC16< sizeof(L".TXT")/2 > KTxt16

const TLitC16 < sizeof(L".TXT")/2 > KTxt16 [static]

const TLitC16< sizeof(L".JPEG")/2 > KJpeg16

const TLitC16 < sizeof(L".JPEG")/2 > KJpeg16 [static]

const TLitC16< sizeof(L".JPG")/2 > KJpg16

const TLitC16 < sizeof(L".JPG")/2 > KJpg16 [static]

const TLitC16< sizeof(L".GIF")/2 > KGif16

const TLitC16 < sizeof(L".GIF")/2 > KGif16 [static]

const TLitC16< sizeof(L".PNG")/2 > KPng16

const TLitC16 < sizeof(L".PNG")/2 > KPng16 [static]

const TLitC16< sizeof(L".MPEG")/2 > KMpeg16

const TLitC16 < sizeof(L".MPEG")/2 > KMpeg16 [static]

const TLitC16< sizeof(L".MPG")/2 > KMpg16

const TLitC16 < sizeof(L".MPG")/2 > KMpg16 [static]

const TLitC16< sizeof(L".MPEG4")/2 > KMpeg416

const TLitC16 < sizeof(L".MPEG4")/2 > KMpeg416 [static]

const TLitC16< sizeof(L".AVI")/2 > KAvi16

const TLitC16 < sizeof(L".AVI")/2 > KAvi16 [static]

const TLitC16< sizeof(L".MP3")/2 > KMp316

const TLitC16 < sizeof(L".MP3")/2 > KMp316 [static]

const TLitC16< sizeof(L".AAC")/2 > KAac16

const TLitC16 < sizeof(L".AAC")/2 > KAac16 [static]

const TLitC16< sizeof(L".WMA")/2 > KWma16

const TLitC16 < sizeof(L".WMA")/2 > KWma16 [static]

const TLitC8< sizeof("application/vnd.pwg-xhtml-print")> KXHtml

const TLitC8 < sizeof("application/vnd.pwg-xhtml-print")> KXHtml [static]

const TLitC8< sizeof("text/html")> KHtml

const TLitC8 < sizeof("text/html")> KHtml [static]

const TLitC8< sizeof("text/xml")> KXml

const TLitC8 < sizeof("text/xml")> KXml [static]

const TLitC8< sizeof("text/plain")> KTxt

const TLitC8 < sizeof("text/plain")> KTxt [static]

const TLitC8< sizeof("image/jpeg")> KJpg

const TLitC8 < sizeof("image/jpeg")> KJpg [static]

const TLitC8< sizeof("image/gif")> KGif

const TLitC8 < sizeof("image/gif")> KGif [static]

const TLitC8< sizeof("image/png")> KPng

const TLitC8 < sizeof("image/png")> KPng [static]

const TLitC8< sizeof("video/mpeg")> KMpeg

const TLitC8 < sizeof("video/mpeg")> KMpeg [static]

const TLitC8< sizeof("video/mpeg4")> KMpeg4

const TLitC8 < sizeof("video/mpeg4")> KMpeg4 [static]

const TLitC8< sizeof("audio/mpeg")> KMp3

const TLitC8 < sizeof("audio/mpeg")> KMp3 [static]

const TLitC8< sizeof("audio/aac")> KAac

const TLitC8 < sizeof("audio/aac")> KAac [static]

const TLitC8< sizeof("audio/x-ms-wma")> KWma

const TLitC8 < sizeof("audio/x-ms-wma")> KWma [static]

const TLitC8< sizeof("video/x-msvideo")> KAvi

const TLitC8 < sizeof("video/x-msvideo")> KAvi [static]

const TLitC< sizeof(L"\r\n")/2 > KLineFeed

const TLitC < sizeof(L"\r\n")/2 > KLineFeed [static]

const TLitC8< sizeof("http:const static TLitC<sizeof(L"upnpfwtemp" )/2> KTemp ={sizeof(L"upnpfwtemp" )/2-1,L"upnpfwtemp" };const static TLitC8<sizeof( "_" )> KUnderScore ={sizeof( "_" )-1, "_" };const static TLitC8<sizeof( "*" )> KStar ={sizeof( "*" )-1, "*" };const static TLitC8<sizeof( ":" )> KColon ={sizeof( ":" )-1, ":" };const static TLitC8<sizeof( "<" )> KKorp ={sizeof( "<" )-1, "<" };const static TLitC8<sizeof( ">" )> KProk ={sizeof( ">" )-1, ">" };const static TLitC8<sizeof( "\"")> KQuotation={sizeof("\"")-1,"\""};const static TLitC8< sizeof("\\")> KDoubleBackSlash={sizeof("\\")-1,"\\"};const static TLitC8< sizeof("/")> KSlash={sizeof("/")-1,"/"};const static TLitC8< sizeof("?")> KQuestionMark={sizeof("?")-1,"?"};const static TLitC8< sizeof("|")> KPipe={sizeof("|")-1,"|"};const static TLitC8< sizeof("\t")> KTab={sizeof("\t")-1,"\t"};const static TLitC8< sizeof(" ")> KSpace={sizeof(" ")-1," "};const TInt KPlaceHolderLength=28;const TInt KBufferLength=256;const TInt KBufferLengthSmall=10;const TInt KCodeSemicolon=58;const TInt KMask=0xFF;const TInt KCodeDot=46;const static TLitC< sizeof(L"%F%Y-%M-%D")/2 > KUpnpDateString={sizeof(L"%F%Y-%M-%D")/2-1, L"%F%Y-%M-%D"};const TInt KMaxDateStringLength=30;const static TLitC8< sizeof("audio/")> KAudioSupport={sizeof("audio/")-1,"audio/"};const static TLitC8< sizeof("image/")> KImageSupport={sizeof("image/")-1,"image/"};const static TLitC8< sizeof("video/")> KVideoSupport={sizeof("video/")-1,"video/"};const static TLitC8< sizeof("=JPEG_")> KImageJpeg={sizeof("=JPEG_")-1,"=JPEG_"};const static TLitC8< sizeof("=PNG_")> KImagePng={sizeof("=PNG_")-1,"=PNG_"};const static TLitC8< sizeof("=AC3")> KAudioAc3={sizeof("=AC3")-1,"=AC3"};const static TLitC8< sizeof("=AMR_")> KAudioAmr={sizeof("=AMR_")-1,"=AMR_"};const static TLitC8< sizeof("=ATRAC3plus")> KAudioAtra={sizeof("=ATRAC3plus")-1,"=ATRAC3plus"};const static TLitC8< sizeof("=LPCM")> KAudioLpcm={sizeof("=LPCM")-1,"=LPCM"};const static TLitC8< sizeof("=MP3")> KAudioMp3={sizeof("=MP3")-1,"=MP3"};const static TLitC8< sizeof("=AAC_")> KAudioAac={sizeof("=AAC_")-1,"=AAC_"};const static TLitC8< sizeof("=HEAAC_")> KAudioHeaac={sizeof("=HEAAC_")-1,"=HEAAC_"};const static TLitC8< sizeof("=BSAC_")> KAudioBsac={sizeof("=BSAC_")-1,"=BSAC_"};const static TLitC8< sizeof("=WMABASE")> KAudioWmab={sizeof("=WMABASE")-1,"=WMABASE"};const static TLitC8< sizeof("=WMAFULL")> KAudioWmaf={sizeof("=WMAFULL")-1,"=WMAFULL"};const static TLitC8< sizeof("=WMAPRO")> KAudioWmap={sizeof("=WMAPRO")-1,"=WMAPRO"};const static TLitC8< sizeof("=MPEG")> KVideoMpeg={sizeof("=MPEG")-1,"=MPEG"};const static TLitC8< sizeof("=AVC_")> KVideoAvc={sizeof("=AVC_")-1,"=AVC_"};const static TLitC8< sizeof("=WMVMED_")> KVideoWmvm={sizeof("=WMVMED_")-1,"=WMVMED_"};const static TLitC8< sizeof("=WMVHIGH_")> KVideoVmvh={sizeof("=WMVHIGH_")-1,"=WMVHIGH_"};const static TLitC8< sizeof("=WMVHM_")> KVideoWmvh={sizeof("=WMVHM_")-1,"=WMVHM_"};const static TLitC8< sizeof("=WMVSPLL_")> KVideoWmvspll={sizeof("=WMVSPLL_")-1,"=WMVSPLL_"};const static TLitC8< sizeof("=WMVSPML_")> KVideoWmvspml={sizeof("=WMVSPML_")-1,"=WMVSPML_"};EXPORT_C TBool UPnPCommonUtils::MemoryCardStateL(){TDriveInfo driveInfo;TBool status=EFalse;RFs fileServer;User::LeaveIfError(fileServer.Connect());CleanupClosePushL(fileServer);TInt error=fileServer.Drive(driveInfo, EDriveE);CleanupStack::PopAndDestroy(&fileServer);if(error==KErrNone &&driveInfo.iType==EMediaHardDisk){status=ETrue;}return status;}EXPORT_C HBufC8 *UPnPCommonUtils::ResolveMimeTypeL(const TDesC &aFileName){HBufC8 *mimetype=0;mimetype=GetMimeTypeByExtensionL(aFileName);if(!mimetype){RApaLsSession sess;TInt error=sess.Connect();if(error==KErrNone){CleanupClosePushL(sess);TUid id=TUid::Uid(0);TDataType type;error=sess.AppForDocument(aFileName, id, type);if(error==KErrNone){mimetype=HBufC8::NewL(type.Des8().Length()+KLineFeed().Length());mimetype- Des

const TLitC8 < sizeof("http:const static TLitC <sizeof(L"upnpfwtemp" )/2> KTemp ={sizeof(L"upnpfwtemp" )/2-1,L"upnpfwtemp" };const static TLitC8 <sizeof( "_" )> KUnderScore ={sizeof( "_" )-1, "_" };const static TLitC8 <sizeof( "*" )> KStar ={sizeof( "*" )-1, "*" };const static TLitC8 <sizeof( ":" )> KColon ={sizeof( ":" )-1, ":" };const static TLitC8 <sizeof( "<" )> KKorp ={sizeof( "<" )-1, "<" };const static TLitC8 <sizeof( ">" )> KProk ={sizeof( ">" )-1, ">" };const static TLitC8 <sizeof( "\"")> KQuotation={sizeof("\"")-1,"\""};const static TLitC8 < sizeof("\\")> KDoubleBackSlash={sizeof("\\")-1,"\\"};const static TLitC8 < sizeof("/")> KSlash={sizeof("/")-1,"/"};const static TLitC8 < sizeof("?")> KQuestionMark={sizeof("?")-1,"?"};const static TLitC8 < sizeof("|")> KPipe={sizeof("|")-1,"|"};const static TLitC8 < sizeof("\t")> KTab={sizeof("\t")-1,"\t"};const static TLitC8 < sizeof(" ")> KSpace={sizeof(" ")-1," "};const TInt KPlaceHolderLength=28;const TInt KBufferLength=256;const TInt KBufferLengthSmall=10;const TInt KCodeSemicolon=58;const TInt KMask=0xFF;const TInt KCodeDot=46;const static TLitC< sizeof(L"%F%Y-%M-%D")/2 > KUpnpDateString={sizeof(L"%F%Y-%M-%D")/2-1, L"%F%Y-%M-%D"};const TInt KMaxDateStringLength=30;const static TLitC8< sizeof("audio/")> KAudioSupport={sizeof("audio/")-1,"audio/"};const static TLitC8< sizeof("image/")> KImageSupport={sizeof("image/")-1,"image/"};const static TLitC8< sizeof("video/")> KVideoSupport={sizeof("video/")-1,"video/"};const static TLitC8< sizeof("=JPEG_")> KImageJpeg={sizeof("=JPEG_")-1,"=JPEG_"};const static TLitC8< sizeof("=PNG_")> KImagePng={sizeof("=PNG_")-1,"=PNG_"};const static TLitC8< sizeof("=AC3")> KAudioAc3={sizeof("=AC3")-1,"=AC3"};const static TLitC8< sizeof("=AMR_")> KAudioAmr={sizeof("=AMR_")-1,"=AMR_"};const static TLitC8< sizeof("=ATRAC3plus")> KAudioAtra={sizeof("=ATRAC3plus")-1,"=ATRAC3plus"};const static TLitC8< sizeof("=LPCM")> KAudioLpcm={sizeof("=LPCM")-1,"=LPCM"};const static TLitC8< sizeof("=MP3")> KAudioMp3={sizeof("=MP3")-1,"=MP3"};const static TLitC8< sizeof("=AAC_")> KAudioAac={sizeof("=AAC_")-1,"=AAC_"};const static TLitC8< sizeof("=HEAAC_")> KAudioHeaac={sizeof("=HEAAC_")-1,"=HEAAC_"};const static TLitC8< sizeof("=BSAC_")> KAudioBsac={sizeof("=BSAC_")-1,"=BSAC_"};const static TLitC8< sizeof("=WMABASE")> KAudioWmab={sizeof("=WMABASE")-1,"=WMABASE"};const static TLitC8< sizeof("=WMAFULL")> KAudioWmaf={sizeof("=WMAFULL")-1,"=WMAFULL"};const static TLitC8< sizeof("=WMAPRO")> KAudioWmap={sizeof("=WMAPRO")-1,"=WMAPRO"};const static TLitC8< sizeof("=MPEG")> KVideoMpeg={sizeof("=MPEG")-1,"=MPEG"};const static TLitC8< sizeof("=AVC_")> KVideoAvc={sizeof("=AVC_")-1,"=AVC_"};const static TLitC8< sizeof("=WMVMED_")> KVideoWmvm={sizeof("=WMVMED_")-1,"=WMVMED_"};const static TLitC8< sizeof("=WMVHIGH_")> KVideoVmvh={sizeof("=WMVHIGH_")-1,"=WMVHIGH_"};const static TLitC8< sizeof("=WMVHM_")> KVideoWmvh={sizeof("=WMVHM_")-1,"=WMVHM_"};const static TLitC8< sizeof("=WMVSPLL_")> KVideoWmvspll={sizeof("=WMVSPLL_")-1,"=WMVSPLL_"};const static TLitC8< sizeof("=WMVSPML_")> KVideoWmvspml={sizeof("=WMVSPML_")-1,"=WMVSPML_"};EXPORT_C TBool UPnPCommonUtils::MemoryCardStateL(){TDriveInfo driveInfo;TBool status=EFalse;RFs fileServer;User::LeaveIfError(fileServer.Connect());CleanupClosePushL(fileServer);TInt error=fileServer.Drive(driveInfo, EDriveE);CleanupStack::PopAndDestroy(&fileServer);if(error==KErrNone &&driveInfo.iType==EMediaHardDisk){status=ETrue;}return status;}EXPORT_C HBufC8 *UPnPCommonUtils::ResolveMimeTypeL(const TDesC &aFileName){HBufC8 *mimetype=0;mimetype=GetMimeTypeByExtensionL(aFileName);if(!mimetype){RApaLsSession sess;TInt error=sess.Connect();if(error==KErrNone){CleanupClosePushL(sess);TUid id=TUid::Uid(0);TDataType type;error=sess.AppForDocument(aFileName, id, type);if(error==KErrNone){mimetype=HBufC8::NewL(type.Des8().Length()+KLineFeed().Length());mimetype- Des [static]

Des()

mimetype Des ( )

CleanupStack::PopAndDestroy & sess

CleanupStack::PopAndDestroy & sess

return mimetype

return mimetype