📄 kwqchar.cpp
字号:
/*
* Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
* Portions Copyright (c) 2005 Nokia Corporation, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "KWQString.h"
#include "KWQLogging.h"
#include <e32std.h>
// this implementation is in reference to:
// http://developer.apple.com/documentation/CoreFoundation/Reference/CFCharacterSetRef/Reference/ConstantsIndex.html
bool QChar::isDigitNonASCII(TChar c)
{
return c.IsDigit();
}
// Unicode General Category L*, M*
bool QChar::isLetterNonASCII(TChar c)
{
return c.IsAlpha() || ( ( c.GetCategory() & 0xF0 ) == TChar::EMarkGroup );
}
// Unicode General Category N*
bool QChar::isNumberNonASCII(TChar c)
{
return ( c.GetCategory() & 0xF0 ) == TChar::ENumberGroup;
}
// Unicode General Category L*, M*, N*
bool QChar::isLetterOrNumberNonASCII(TChar c)
{
return isLetterNonASCII(c) || isNumberNonASCII(c);
}
bool QChar::isPunct() const
{
return TChar(c).IsPunctuation();
}
TChar QChar::lowerNonASCII(TChar c)
{
return c.GetLowerCase();
}
TChar QChar::upperNonASCII(TChar c)
{
return c.GetUpperCase();
}
bool QChar::mirrored() const
{
return TChar(c).IsMirrored();
}
QChar QChar::mirroredChar() const
{
//### FIXME NOKIA: no implementation in Symbian
return c;
}
int QChar::digitValueNonASCII(TChar c)
{
return c.GetNumericValue();
}
QChar::Direction QChar::direction() const
{
static const QChar::Direction dirmap [] =
{
QChar::DirL, QChar::DirLRE, QChar::DirLRO,
QChar::DirR, QChar::DirAL, QChar::DirRLE, QChar::DirRLO,
QChar::DirPDF, QChar::DirEN, QChar::DirES, QChar::DirET, QChar::DirAN, QChar::DirCS,
QChar::DirNSM, QChar::DirBN, QChar::DirB, QChar::DirS, QChar::DirWS, QChar::DirON
};
return dirmap[TChar(c).GetBdCategory()];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -