本文整理汇总了PHP中QString::StringReversePosition方法的典型用法代码示例。如果您正苦于以下问题:PHP QString::StringReversePosition方法的具体用法?PHP QString::StringReversePosition怎么用?PHP QString::StringReversePosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QString
的用法示例。
在下文中一共展示了QString::StringReversePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProcessLinkLocationWikiPage
protected static function ProcessLinkLocationWikiPage($chrCurrent = null)
{
// Pop off LinkLocation
$objState = self::$objStateStack->Pop();
$strLocation = $objState->Buffer;
// Pop off LinkProtocol
$objState = self::$objStateStack->Pop();
$strProtocol = $objState->Buffer;
// Pop off End Quote
$objState = self::$objStateStack->Pop();
if ($objState->State != QTextStyle::StateEndQuote) {
throw new Exception('Could not find In-LinkContent EndQuote State');
}
// Cancel everything through the matching start quote
self::CancelToState(QTextStyle::StateStartQuote);
// Pop off the Start Quote at the top of the stack
$objState = self::$objStateStack->Pop();
$strContent = $objState->Buffer;
// Clean up the Location string so that it starts with one and exactly one forward slash
$strLocation = '/' . $strLocation;
while (strpos($strLocation, '//') === 0) {
$strLocation = substr($strLocation, 1);
}
// Calculate end-of-location
$strNeedle = '/[A-Za-z0-9\\_\\/\\:]/';
$intValue = QString::StringReversePosition($strLocation, $strNeedle);
// Clean Up the URL Path for a Wiki Link
$strPath = WikiItem::SanitizeForPath(substr($strLocation, 0, $intValue + 1), $intWikiItemTypeId);
$strSanitizedFullPath = WikiItem::GenerateFullPath($strPath, $intWikiItemTypeId);
// Process as a URL-based link to the wiki
$strUrlLink = sprintf('<a href="/wiki%s">%s</a>', $strSanitizedFullPath, $strContent);
self::$objStateStack->AddToTopBuffer($strUrlLink);
// Add any tail/unprocessed stuff back to the content stack
QTextStyleInline::$strInlineContent = substr($strLocation, $intValue + 1) . QTextStyleInline::$strInlineContent;
}