本文整理汇总了C++中ToUpperCase函数的典型用法代码示例。如果您正苦于以下问题:C++ ToUpperCase函数的具体用法?C++ ToUpperCase怎么用?C++ ToUpperCase使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ToUpperCase函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsCaseChangeableChar
static bool
IsCaseChangeableChar(uint32_t aChar)
{
return IS_IN_BMP(aChar) &&
ToLowerCase(static_cast<char16_t>(aChar)) !=
ToUpperCase(static_cast<char16_t>(aChar));
}
示例2: ToUpperCase
/* static */
void
txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
{
if (aNode.isDocument()) {
aLocalName.Truncate();
return;
}
if (aNode.isContent()) {
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
nodeInfo->GetLocalName(aLocalName);
// Check for html
if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
aNode.mNode->IsNodeOfType(nsINode::eHTML)) {
ToUpperCase(aLocalName);
}
return;
}
if (aNode.mNode->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
// PIs don't have a nodeinfo but do have a name
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
node->GetNodeName(aLocalName);
return;
}
aLocalName.Truncate();
return;
}
aNode.Content()->GetAttrNameAt(aNode.mIndex)->LocalName()->
ToString(aLocalName);
// Check for html
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
ToUpperCase(aLocalName);
}
}
示例3: assert
bool vrResourceManager::AddTexture( vrTexture *texture_p )
{
assert( texture_p );
if ( !texture_p ) return false;
ToUpperCase( texture_p->cName );
if ( t_list ) t_list->insert( t_list->end(), texture_p );
return true;
}
示例4: return
bool
Tokenizer::IsWordFirst(const char aInput) const
{
// TODO: make this fully work with unicode
return (ToLowerCase(static_cast<uint32_t>(aInput)) !=
ToUpperCase(static_cast<uint32_t>(aInput))) ||
'_' == aInput ||
(mAdditionalWordChars ? !!strchr(mAdditionalWordChars, aInput) : false);
}
示例5: outfile
// make a search for the user's input
// inside the database of the program
void TechBot::selectMatch()
{
std::fstream outfile("keywords.txt", std::ios::out);
RespLISTonse.clear();
// introduce thse new "string variable" to help
// support the implementation of keyword ranking
// during the matching process
std::string bestKeyWord;
Vstr ListOfWord;
if(TB_Input.find("**") == std::string::npos)
{
RightClear(TB_Input, ".");
ToUpperCase(TB_Input);
SplitToWords(TB_Input, ListOfWord);
bestKeyWord = findBestKey(ListOfWord);
TB_KeyWord = bestKeyWord;
}
else
{
TB_KeyWord = TB_Input;
}
bool found=false;
for(mapString ::iterator it=KnowledgeBase.begin();it!=KnowledgeBase.end();it++)
{
std::string temp=it->first;
if((std::string)temp==(std::string)TB_KeyWord)
found=true;
}
if(!found)
{
for(mapString ::iterator it=KnowledgeBase.begin();it!=KnowledgeBase.end();it++)
{
std::string temp=it->first;
if(temp.find(TB_Input)!=std::string::npos)
{
found=true;
}
}
}
if(found)
{ std::string tt=TB_KeyWord;
std::vector<TBResponse> RespLISTObj = KnowledgeBase[tt];
RespListgetter(RespLISTObj);
}
}
示例6: ToUpperCase
/* static */
void
txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
{
if (aNode.isDocument()) {
aName.Truncate();
return;
}
if (aNode.isContent()) {
if (aNode.mNode->IsElement()) {
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
nodeInfo->GetQualifiedName(aName);
// Check for html
if (aNode.Content()->IsHTML() &&
aNode.Content()->IsInHTMLDocument()) {
ToUpperCase(aName);
}
return;
}
if (aNode.mNode->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
// PIs don't have a nodeinfo but do have a name
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
node->GetNodeName(aName);
return;
}
aName.Truncate();
return;
}
aNode.Content()->GetAttrNameAt(aNode.mIndex)->GetQualifiedName(aName);
// Check for html
if (aNode.Content()->IsHTML()) {
ToUpperCase(aName);
}
}
示例7: ToFirstLetterCapitalised
//-----------------------------------------------------------------------
void ToFirstLetterCapitalised(std::string& str)
{
std::string strLower=str;
std::string strUpper=str;
ToLowerCase(strLower);
ToUpperCase(strUpper);
if(strUpper.length() > 0)
str=strUpper.substr(0,1);
if(strLower.length() > 1)
str=str+strLower.substr(1,strLower.length()-1);
}
示例8: ToUpperCase
void
ToUpperCase(const nsAString& aSource,
nsAString& aDest)
{
const PRUnichar *in;
PRUnichar *out;
PRUint32 len = NS_StringGetData(aSource, &in);
NS_StringGetMutableData(aDest, len, &out);
NS_ASSERTION(out, "Uh...");
ToUpperCase(in, out, len);
}
示例9: ToUpperCase
void
ToUpperCase(const nsAString& aSource,
nsAString& aDest)
{
const char16_t *in = aSource.BeginReading();
uint32_t len = aSource.Length();
aDest.SetLength(len);
char16_t *out = aDest.BeginWriting();
ToUpperCase(in, out, len);
}
示例10: while
PRUint32 FontAliasKey::HashCode(void) const
{
PRUint32 hash = 0;
const PRUnichar* string = mString.get();
PRUnichar ch;
while ((ch = *string++) != 0) {
// FYI: hash = hash*37 + ch
ch = ToUpperCase(ch);
hash = ((hash << 5) + (hash << 2) + hash) + ch;
}
return hash;
}
示例11: ToUpperCase
void TechBot::welcome_user()
{
std::cout<<"What is your name?\n>";
std::getline(std::cin,user_name);
ToUpperCase(user_name);
for(int i=user_name.length()-1;i>=0;i--)
{
if(user_name[i]==' ')
{user_name=user_name.substr(i+1,user_name.length()-i+1);break;}
}
std::cout<<"Hi "<<user_name<<std::endl;
}
示例12: DeviceId
/* readonly attribute DOMString DisplayVendorID; */
NS_IMETHODIMP nsSystemInfo::GetDisplayVendorID(nsAString & aDisplayVendorID)
{
nsCString DeviceId(mDeviceID);
ToUpperCase(DeviceId);
PRInt32 start = DeviceId.Find(NS_LITERAL_CSTRING("VEN_"));
PRInt32 end = DeviceId.Find(NS_LITERAL_CSTRING("&"), start);
DeviceId.Cut(end, DeviceId.Length());
DeviceId.Cut(0, start + 4);
DeviceId.Insert("0x", 0, 2);
aDisplayVendorID.AssignLiteral(DeviceId.BeginReading());
return NS_OK;
}
示例13: FindInReadable
// the following block is to append the accesskey to mTitle if there is an accesskey
// but the mTitle doesn't have the character
void
nsTextBoxFrame::UpdateAccessTitle()
{
/*
* Note that if you change appending access key label spec,
* you need to maintain same logic in following methods. See bug 324159.
* toolkit/content/commonDialog.js (setLabelForNode)
* toolkit/content/widgets/text.xml (formatAccessKey)
*/
PRInt32 menuAccessKey;
nsMenuBarListener::GetMenuAccessKey(&menuAccessKey);
if (!menuAccessKey || mAccessKey.IsEmpty())
return;
if (!AlwaysAppendAccessKey() &&
FindInReadable(mAccessKey, mTitle, nsCaseInsensitiveStringComparator()))
return;
nsAutoString accessKeyLabel;
accessKeyLabel += '(';
accessKeyLabel += mAccessKey;
ToUpperCase(accessKeyLabel);
accessKeyLabel += ')';
if (mTitle.IsEmpty()) {
mTitle = accessKeyLabel;
return;
}
const nsDependentString& kEllipsis = nsContentUtils::GetLocalizedEllipsis();
PRUint32 offset = mTitle.Length();
if (StringEndsWith(mTitle, kEllipsis)) {
offset -= kEllipsis.Length();
} else if (StringEndsWith(mTitle, OLD_ELLIPSIS)) {
// Try to check with our old ellipsis (for old addons)
offset -= OLD_ELLIPSIS.Length();
} else {
// Try to check with
// our default ellipsis (for non-localized addons) or ':'
const PRUnichar kLastChar = mTitle.Last();
if (kLastChar == PRUnichar(0x2026) || kLastChar == PRUnichar(':'))
offset--;
}
if (InsertSeparatorBeforeAccessKey() &&
offset > 0 && !NS_IS_SPACE(mTitle[offset - 1])) {
mTitle.Insert(' ', offset);
offset++;
}
mTitle.Insert(accessKeyLabel, offset);
}
示例14: BrotliTransformDictionaryWord
int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len,
const BrotliTransforms* transforms, int transform_idx) {
int idx = 0;
const uint8_t* prefix = BROTLI_TRANSFORM_PREFIX(transforms, transform_idx);
uint8_t type = BROTLI_TRANSFORM_TYPE(transforms, transform_idx);
const uint8_t* suffix = BROTLI_TRANSFORM_SUFFIX(transforms, transform_idx);
{
int prefix_len = *prefix++;
while (prefix_len--) { dst[idx++] = *prefix++; }
}
{
const int t = type;
int i = 0;
if (t <= BROTLI_TRANSFORM_OMIT_LAST_9) {
len -= t;
} else if (t >= BROTLI_TRANSFORM_OMIT_FIRST_1
&& t <= BROTLI_TRANSFORM_OMIT_FIRST_9) {
int skip = t - (BROTLI_TRANSFORM_OMIT_FIRST_1 - 1);
word += skip;
len -= skip;
}
while (i < len) { dst[idx++] = word[i++]; }
if (t == BROTLI_TRANSFORM_UPPERCASE_FIRST) {
ToUpperCase(&dst[idx - len]);
} else if (t == BROTLI_TRANSFORM_UPPERCASE_ALL) {
uint8_t* uppercase = &dst[idx - len];
while (len > 0) {
int step = ToUpperCase(uppercase);
uppercase += step;
len -= step;
}
}
}
{
int suffix_len = *suffix++;
while (suffix_len--) { dst[idx++] = *suffix++; }
return idx;
}
}
示例15: ToUpperCase
vrTriObject2* vrResourceManager::GetObject( LPSTR strObjectName )
{
ToUpperCase( strObjectName );
assert( o_list );
if ( !o_list ) return NULL;
O_LIST::iterator i = o_list->begin();
vrTriObject2 *object;
while( i != o_list->end() )
{
object = *i;
ToUpperCase( object->cName );
if ( strncmp( object->cName, strObjectName , 32 ) == 0 ) return object;
i++;
}
return NULL;
}