本文整理汇总了C++中NPT_String::Right方法的典型用法代码示例。如果您正苦于以下问题:C++ NPT_String::Right方法的具体用法?C++ NPT_String::Right怎么用?C++ NPT_String::Right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPT_String
的用法示例。
在下文中一共展示了NPT_String::Right方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query
/*----------------------------------------------------------------------
| PLT_FileMediaServer::ProcessFileRequest
+---------------------------------------------------------------------*/
NPT_Result
PLT_FileMediaServer::ProcessFileRequest(NPT_HttpRequest& request,
NPT_HttpResponse& response,
NPT_SocketInfo& client_info)
{
NPT_COMPILER_UNUSED(client_info);
NPT_LOG_FINE("PLT_FileMediaServer::ProcessFileRequest Received Request:");
PLT_LOG_HTTP_MESSAGE(NPT_LOG_LEVEL_FINE, &request);
response.GetHeaders().SetHeader("Accept-Ranges", "bytes");
if (request.GetMethod().Compare("GET") && request.GetMethod().Compare("HEAD")) {
response.SetStatus(500, "Internal Server Error");
return NPT_SUCCESS;
}
// File requested
NPT_String path = m_FileBaseUri.GetPath();
NPT_String strUri = NPT_Uri::PercentDecode(request.GetUrl().GetPath());
NPT_HttpUrlQuery query(request.GetUrl().GetQuery());
NPT_String file_path = query.GetField("path");
// hack for XBMC support for 360, we urlencoded the ? to that the 360 doesn't strip out the query
// but then the query ends being parsed as part of the path
int index = strUri.Find("path=");
if (index>0) file_path = strUri.Right(strUri.GetLength()-index-5);
if (file_path.GetLength() == 0) goto failure;
// HACK for wmp: somehow they inverse our slashes !
// do it only if we're on windows
if (m_DirDelimiter == "\\") {
file_path.Replace('/', '\\');
}
if (path.Compare(strUri.Left(path.GetLength()), true) == 0) {
NPT_Integer start, end;
PLT_HttpHelper::GetRange(&request, start, end);
return PLT_FileServer::ServeFile(m_Path + file_path, &response, start, end, !request.GetMethod().Compare("HEAD"));
}
// Album Art requested
path = m_AlbumArtBaseUri.GetPath();
if (path.Compare(strUri.Left(path.GetLength()), true) == 0) {
return OnAlbumArtRequest(m_Path + file_path, response);
}
failure:
response.SetStatus(404, "File Not Found");
return NPT_SUCCESS;
}