• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IsText函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IsText函数的典型用法代码示例。如果您正苦于以下问题:C++ IsText函数的具体用法?C++ IsText怎么用?C++ IsText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IsText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PeekWhiteSpace

//-----------------------------------------------------------------------------
// Peek size of sting to come, check memory bound
//-----------------------------------------------------------------------------
int	CUtlBufferEditor::PeekStringLength()
{
	if ( !IsValid() )
		return 0;

	// Eat preceeding whitespace
	int nOffset = 0;
	if ( IsText() )
	{
		nOffset = PeekWhiteSpace( nOffset );
	}

	int nStartingOffset = nOffset;

	do
	{
		int nPeekAmount = 128;

		// NOTE: Add 1 for the terminating zero!
		if ( !CheckArbitraryPeekGet( nOffset, nPeekAmount ) )
		{
			if ( nOffset == nStartingOffset )
				return 0;
			return nOffset - nStartingOffset + 1;
		}

		const char *pTest = (const char *)PeekGet( nOffset );

		if ( !IsText() )
		{
			for ( int i = 0; i < nPeekAmount; ++i )
			{
				// The +1 here is so we eat the terminating 0
				if ( pTest[i] == 0 )
					return (i + nOffset - nStartingOffset + 1);
			}
		}
		else
		{
			for ( int i = 0; i < nPeekAmount; ++i )
			{
				// The +1 here is so we eat the terminating 0
				if ( isspace((unsigned char)pTest[i]) || (pTest[i] == 0) )
					return (i + nOffset - nStartingOffset + 1);
			}
		}

		nOffset += nPeekAmount;

	} while ( true );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:54,代码来源:exported_utilities.cpp


示例2: PeekStringLength

//-----------------------------------------------------------------------------
// Reads a null-terminated string
//-----------------------------------------------------------------------------
void CUtlBufferEditor::GetString( char* pString, int nMaxChars )
{
	if (!IsValid())
	{
		*pString = 0;
		return;
	}

	if ( nMaxChars == 0 )
	{
		nMaxChars = INT_MAX;
	}

	// Remember, this *includes* the null character
	// It will be 0, however, if the buffer is empty.
	int nLen = PeekStringLength();

	if ( IsText() )
	{
		EatWhiteSpace();
	}

	if ( nLen == 0 )
	{
		*pString = 0;
		m_Error |= GET_OVERFLOW;
		return;
	}
	
	// Strip off the terminating NULL
	if ( nLen <= nMaxChars )
	{
		Get( pString, nLen - 1 );
		pString[ nLen - 1 ] = 0;
	}
	else
	{
		Get( pString, nMaxChars - 1 );
		pString[ nMaxChars - 1 ] = 0;
		SeekGet( SEEK_CURRENT, nLen - 1 - nMaxChars );
	}

	// Read the terminating NULL in binary formats
	if ( !IsText() )
	{
		VerifyEquals( GetChar(), 0 );
	}
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:51,代码来源:exported_utilities.cpp


示例3: PutDelimitedString

void CUtlBufferEditor::PutDelimitedString( CUtlCharConversion *pConv, const char *pString )
{
	if ( !IsText() || !pConv )
	{
		PutString( pString );
		return;
	}

	if ( WasLastCharacterCR() )
	{
		PutTabs();
	}
	Put( pConv->GetDelimiter(), pConv->GetDelimiterLength() );

	int nLen = pString ? Q_strlen( pString ) : 0;
	for ( int i = 0; i < nLen; ++i )
	{
		PutDelimitedCharInternal( pConv, pString[i] );
	}

	if ( WasLastCharacterCR() )
	{
		PutTabs();
	}
	Put( pConv->GetDelimiter(), pConv->GetDelimiterLength() );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:26,代码来源:exported_utilities.cpp


示例4: if

BOOL CMyBCGPProp::TextToVar(const CString& strText)
{
	BOOL bRet = CBCGPProp::TextToVar(strText);
	if (bRet)
	{
		if ((m_dwFlags & PROP_HAS_SPIN) && m_varValue.vt == VT_INT)
		{
			if (m_varValue.intVal < m_nMinValue)
			{
				m_varValue.intVal = m_nMinValue;
			}
			if (m_varValue.intVal > m_nMaxValue)
			{
				m_varValue.intVal = m_nMaxValue;
			}
		}
		else if (IsText())
		{
			if (strText.Find('-') != -1)
			{
				CString strNewText(strText);
				strNewText.Replace('-', '_');

				m_varValue = (LPCTSTR)strNewText;
			}
		}
	}
	return bRet;
}
开发者ID:20400992,项目名称:CoolFormat,代码行数:29,代码来源:MyBCGPProp.cpp


示例5: nodeInfo

void TSorterListItem::Init()
{
	// Set DataType based on entry_ref
	BFile theFile; 
	if ( theFile.SetTo(&m_EntryRef, B_READ_WRITE) == B_OK )
	{		
		// Create node
		BNodeInfo nodeInfo(&theFile);
		if (nodeInfo.InitCheck() == B_NO_ERROR)
		{
			if (IsAudio(nodeInfo))
				m_DataType = kAudioType;
			else if (IsImage(nodeInfo))
				m_DataType = kPictureType;
			else if (IsText(nodeInfo))
				m_DataType = kTextType;
			else if (IsVideo(nodeInfo))
				m_DataType = kVideoType;
		}
		else
		{
			m_DataType = kUnknownType;	
		}	
		
		theFile.Unset();
	}
}
开发者ID:ModeenF,项目名称:UltraDV,代码行数:27,代码来源:TSorterListItem.cpp


示例6: Assert

bool CUtlInplaceBuffer::InplaceGetLinePtr( char **ppszInBufferPtr, int *pnLineLength )
{
	Assert( IsText() && !ContainsCRLF() );

	int nLineLen = PeekLineLength();
	if ( nLineLen <= 1 )
	{
		SeekGet( SEEK_TAIL, 0 );
		return false;
	}

	-- nLineLen; // because it accounts for putting a terminating null-character

	char *pszLine = ( char * ) const_cast< void * >( PeekGet() );
	SeekGet( SEEK_CURRENT, nLineLen );

	// Set the out args
	if ( ppszInBufferPtr )
		*ppszInBufferPtr = pszLine;
	
	if ( pnLineLength )
		*pnLineLength = nLineLen;

	return true;
}
开发者ID:FWGS,项目名称:libvinterface,代码行数:25,代码来源:utlbuffer.cpp


示例7: do_QueryInterface

PRBool
nsAccUtils::IsTextInterfaceSupportCorrect(nsIAccessible *aAccessible)
{
  PRBool foundText = PR_FALSE;
  
  nsCOMPtr<nsIAccessibleDocument> accDoc = do_QueryInterface(aAccessible);
  if (accDoc) {
    // Don't test for accessible docs, it makes us create accessibles too
    // early and fire mutation events before we need to
    return PR_TRUE;
  }

  nsCOMPtr<nsIAccessible> child, nextSibling;
  aAccessible->GetFirstChild(getter_AddRefs(child));
  while (child) {
    if (IsText(child)) {
      foundText = PR_TRUE;
      break;
    }
    child->GetNextSibling(getter_AddRefs(nextSibling));
    child.swap(nextSibling);
  }

  if (foundText) {
    // found text child node
    nsCOMPtr<nsIAccessibleText> text = do_QueryInterface(aAccessible);
    if (!text)
      return PR_FALSE;
  }

  return PR_TRUE; 
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:32,代码来源:nsAccUtils.cpp


示例8: NS_SUCCEEDED

PRInt32
nsAccUtils::TextLength(nsIAccessible *aAccessible)
{
  if (!IsText(aAccessible))
    return 1;
  
  nsRefPtr<nsAccessNode> accNode = nsAccUtils::QueryAccessNode(aAccessible);
  
  nsIFrame *frame = accNode->GetFrame();
  if (frame && frame->GetType() == nsAccessibilityAtoms::textFrame) {
    // Ensure that correct text length is calculated (with non-rendered
    // whitespace chars not counted).
    nsIContent *content = frame->GetContent();
    if (content) {
      PRUint32 length;
      nsresult rv = nsHyperTextAccessible::
        ContentToRenderedOffset(frame, content->TextLength(), &length);
      return NS_SUCCEEDED(rv) ? static_cast<PRInt32>(length) : -1;
    }
  }
  
  // For list bullets (or anything other accessible which would compute its own
  // text. They don't have their own frame.
  // XXX In the future, list bullets may have frame and anon content, so 
  // we should be able to remove this at that point
  nsRefPtr<nsAccessible> acc(nsAccUtils::QueryAccessible(aAccessible));

  nsAutoString text;
  acc->AppendTextTo(text, 0, PR_UINT32_MAX); // Get all the text
  return text.Length();
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:31,代码来源:nsAccUtils.cpp


示例9: do_QueryObject

PRBool
nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
{
  PRBool foundText = PR_FALSE;
  
  nsCOMPtr<nsIAccessibleDocument> accDoc = do_QueryObject(aAccessible);
  if (accDoc) {
    // Don't test for accessible docs, it makes us create accessibles too
    // early and fire mutation events before we need to
    return PR_TRUE;
  }

  PRInt32 childCount = aAccessible->GetChildCount();
  for (PRint32 childIdx = 0; childIdx < childCount; childIdx++) {
    nsAccessible *child = GetChildAt(childIdx);
    if (IsText(child)) {
      foundText = PR_TRUE;
      break;
    }
  }

  if (foundText) {
    // found text child node
    nsCOMPtr<nsIAccessibleText> text = do_QueryObject(aAccessible);
    if (!text)
      return PR_FALSE;
  }

  return PR_TRUE; 
}
开发者ID:h4ck3rm1k3,项目名称:v8monkey,代码行数:30,代码来源:nsAccUtils.cpp


示例10: PutDelimitedChar

void CUtlBufferEditor::PutDelimitedChar( CUtlCharConversion *pConv, char c )
{
	if ( !IsText() || !pConv )
	{
		PutChar( c );
		return;
	}

	PutDelimitedCharInternal( pConv, c );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:10,代码来源:exported_utilities.cpp


示例11: CrashIf

// reparse point is an address within html that we can
// can feed to HtmlPullParser() to start parsing from that point
const char *HtmlToken::GetReparsePoint() const
{
    if (IsStartTag() || IsEmptyElementEndTag())
        return s - 1;
    if (IsEndTag())
        return s - 2;
    if (IsText())
        return s;
    CrashIf(true); // don't call us on error tokens
    return NULL;
}
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:13,代码来源:HtmlPullParser.cpp


示例12: OnClickButton

void CMyBCGPProp::OnClickButton(CPoint point)
{
	CBCGPProp::OnClickButton(point);
	if (IsText())
	{
		ASSERT_VALID(this);
		ASSERT_VALID(m_pWndList);
		ASSERT_VALID(m_pWndInPlace);
		ASSERT(::IsWindow(m_pWndInPlace->GetSafeHwnd()));

		m_bButtonIsDown = TRUE;
		m_bButtonIsHighlighted = FALSE;
		Redraw();

		CString strPath = (LPCTSTR)(_bstr_t)m_varValue;
		BOOL bUpdate = FALSE;

		CMulTextEditDlg dlg;
		dlg.SetText(strPath);
		if (dlg.DoModal() == IDOK)
		{
			bUpdate = TRUE;
			strPath = dlg.GetText();
		}

		if (bUpdate)
		{
			if (strPath.Find('-') != -1)
			{
				strPath.Replace('-', '_');
			}

			if (m_pWndInPlace != NULL)
			{
				m_pWndInPlace->SetWindowText(strPath);
			}

			m_varValue = (LPCTSTR)strPath;
		}

		m_bButtonIsDown = FALSE;
		Redraw();

		if (m_pWndInPlace != NULL)
		{
			m_pWndInPlace->SetFocus();
		}
		else
		{
			m_pWndList->SetFocus();
		}
	}
}
开发者ID:20400992,项目名称:CoolFormat,代码行数:53,代码来源:MyBCGPProp.cpp


示例13: EatWhiteSpace

//-----------------------------------------------------------------------------
// Eats whitespace
//-----------------------------------------------------------------------------
void CUtlBufferEditor::EatWhiteSpace()
{
	if ( IsText() && IsValid() )
	{
		while ( CheckGet( sizeof(char) ) )
		{
			if ( !isspace( *(const unsigned char*)PeekGet() ) )
				break;
			m_Get += sizeof(char);
		}
	}
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:15,代码来源:exported_utilities.cpp


示例14: PutString

//-----------------------------------------------------------------------------
// Writes a null-terminated string
//-----------------------------------------------------------------------------
void CUtlBufferEditor::PutString( const char* pString )
{
	if (!IsText())
	{
		if ( pString )
		{
			// Not text? append a null at the end.
			size_t nLen = Q_strlen( pString ) + 1;
			Put( pString, nLen * sizeof(char) );
			return;
		}
		else
		{
			PutTypeBin<char>( 0 );
		}
	}
	else if (pString)
	{
		int nTabCount = ( m_Flags & AUTO_TABS_DISABLED ) ? 0 : m_nTab;
		if ( nTabCount > 0 )
		{
			if ( WasLastCharacterCR() )
			{
				if ( !IsDirectiveLine( pString ) )
					PutTabs();
			}

			const char* pEndl = strchr( pString, '\n' );
			while ( pEndl )
			{
				size_t nSize = (size_t)pEndl - (size_t)pString + sizeof(char);
				Put( pString, nSize );
				pString = pEndl + 1;
				if ( *pString )
				{
					if ( !IsDirectiveLine( pString ) )
						PutTabs();
					pEndl = strchr( pString, '\n' );
				}
				else
				{
					pEndl = NULL;
				}
			}
		}
		size_t nLen = Q_strlen( pString );
		if ( nLen )
		{
			Put( pString, nLen * sizeof(char) );
		}
	}
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:55,代码来源:exported_utilities.cpp


示例15: GetDelimitedString

void CUtlBufferEditor::GetDelimitedString( CUtlCharConversion *pConv, char *pString, int nMaxChars )
{
	if ( !IsText() || !pConv )
	{
		GetString( pString, nMaxChars );
		return;
	}

	if (!IsValid())
	{
		*pString = 0;
		return;
	}

	if ( nMaxChars == 0 )
	{
		nMaxChars = INT_MAX;
	}

	EatWhiteSpace();
	if ( !PeekStringMatch( 0, pConv->GetDelimiter(), pConv->GetDelimiterLength() ) )
		return;

	// Pull off the starting delimiter
	SeekGet( SEEK_CURRENT, pConv->GetDelimiterLength() );

	int nRead = 0;
	while ( IsValid() )
	{
		if ( PeekStringMatch( 0, pConv->GetDelimiter(), pConv->GetDelimiterLength() ) )
		{
			SeekGet( SEEK_CURRENT, pConv->GetDelimiterLength() );
			break;
		}

		char c = GetDelimitedCharInternal( pConv );

		if ( nRead < nMaxChars )
		{
			pString[nRead] = c;
			++nRead;
		}
	}

	if ( nRead >= nMaxChars )
	{
		nRead = nMaxChars - 1;
	}
	pString[nRead] = '\0';
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:50,代码来源:exported_utilities.cpp


示例16: IsBlock

BOOL HSCurKeyInfo::IsBlock()
{
	if( IsText() )
	{
		return FALSE;
	}

	if( MakeMarket(m_cCode.m_cCodeType) == STOCK_MARKET 
		&& MakeMainMarket(m_cCode.m_cCodeType) > (STOCK_MARKET|SZ_BOURSE) )
	{
		return TRUE;
	}

	return FALSE;
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:15,代码来源:KeyBoardStruct.cpp


示例17: Name

//---------------------------------------------------------------------------
//
void NFTM::Variable::Dump(NFTM::OutputStream *os) {
    if (os) {
        //os->Write("****** Variable::Dump is BROKEN *****\n");
        os->Write("\t\tvar %s is %s%s\n", Name(), IsNull() ? "null " : "", Kind());
        if (!IsNull() && IsText()) {
            char minibuf[64 + 1];
            NFTM::StrCopy(minibuf, u.text->text, 64);
            char *s = minibuf;
            while (*s && *s != '\n') {
                s++;
            }
            *s = 0;
            os->Write("\t\t\t%s\n", minibuf);
        }
    }
}
开发者ID:quoha,项目名称:StaticCMS,代码行数:18,代码来源:variable.cpp


示例18: ASSERT

void CMyBCGPProp::GetResultShort(CString& strValue)
{
	if (m_lstShortOptions.GetCount() == 0)
	{
		return;
	}

	CString strShort;
	if (IsList())
	{
		POSITION pos = m_lstShortOptions.FindIndex(GetSelectedOption());
		if (pos == NULL)
		{
			ASSERT(FALSE);
			return;
		}

		strShort = m_lstShortOptions.GetAt(pos);
	}
	else
	{
		strShort = m_lstShortOptions.GetHead();
	}

	if (!strShort.IsEmpty())
	{
		CString strFormatProperty = FormatProperty();
		if (IsText())
		{
			if (!strFormatProperty.IsEmpty())
			{
				strValue += STR_SHORT_PREFIX + strShort + STR_SHORT_TEXT_FALG + strFormatProperty;
			}
		} 
		else
		{
			strValue += STR_SHORT_PREFIX + strShort
				+ (IsList() ? _T("") : FormatProperty());
		}

		if (m_pBuddyProp)
		{
			strValue += m_pBuddyProp->FormatProperty();
		}
	}
}
开发者ID:20400992,项目名称:CoolFormat,代码行数:46,代码来源:MyBCGPProp.cpp


示例19:

PRUint32
nsAccUtils::TextLength(nsAccessible *aAccessible)
{
  if (!IsText(aAccessible))
    return 1;

  nsTextAccessible* textLeaf = aAccessible->AsTextLeaf();
  if (textLeaf)
    return textLeaf->Text().Length();

  // For list bullets (or anything other accessible which would compute its own
  // text. They don't have their own frame.
  // XXX In the future, list bullets may have frame and anon content, so 
  // we should be able to remove this at that point
  nsAutoString text;
  aAccessible->AppendTextTo(text); // Get all the text
  return text.Length();
}
开发者ID:h4ck3rm1k3,项目名称:v8monkey,代码行数:18,代码来源:nsAccUtils.cpp


示例20: Assert

//-----------------------------------------------------------------------------
// Modifies the buffer to be binary or text; Blows away the buffer and the CONTAINS_CRLF value. 
//-----------------------------------------------------------------------------
void CUtlBufferEditor::SetBufferType( bool bIsText, bool bContainsCRLF )
{
#ifdef _DEBUG
	// If the buffer is empty, there is no opportunity for this stuff to fail
	if ( TellMaxPut() != 0 )
	{
		if ( IsText() )
		{
			if ( bIsText )
			{
				Assert( ContainsCRLF() == bContainsCRLF );
			}
			else
			{
				Assert( ContainsCRLF() );
			}
		}
		else
		{
			if ( bIsText )
			{
				Assert( bContainsCRLF );
			}
		}
	}
#endif

	if ( bIsText )
	{
		m_Flags |= TEXT_BUFFER;
	}
	else
	{
		m_Flags &= ~TEXT_BUFFER;
	}
	if ( bContainsCRLF )
	{
		m_Flags |= CONTAINS_CRLF;
	}
	else
	{
		m_Flags &= ~CONTAINS_CRLF;
	}
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:47,代码来源:exported_utilities.cpp



注:本文中的IsText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsTileType函数代码示例发布时间:2022-05-30
下一篇:
C++ IsTemplate函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap