本文整理汇总了C++中Boolean函数的典型用法代码示例。如果您正苦于以下问题:C++ Boolean函数的具体用法?C++ Boolean怎么用?C++ Boolean使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Boolean函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _bios_keybrd
//#include <stdio.h>
void TEvent::getKeyEvent() {
if ( TSystemError::ctrlBreakHit == Boolean(1) ) {
_bios_keybrd(_KEYBRD_READ);
TSystemError::ctrlBreakHit = Boolean(2);
}
if ( _bios_keybrd(_KEYBRD_READY) == 0 ) {
what = evNothing;
} else {
what = evKeyDown;
keyDown.keyCode = _bios_keybrd(_KEYBRD_READ);
//printf("keyCode=%04X\n",keyDown.keyCode);
switch ( keyDown.charScan.scanCode ) {
case scSpaceKey:
if ( getShiftState() & kbAltShift ) keyDown.keyCode = kbAltSpace;
break;
case scInsKey:
{
unsigned char state = getShiftState();
if ( state & kbCtrlShift ) keyDown.keyCode = kbCtrlIns;
else if ( state & (kbLeftShift|kbRightShift) ) keyDown.keyCode = kbShiftIns;
}
break;
case scDelKey:
{
unsigned char state = getShiftState();
if ( state & kbCtrlShift ) keyDown.keyCode = kbCtrlDel;
else if ( state & (kbLeftShift|kbRightShift) ) keyDown.keyCode = kbShiftDel;
}
break;
}
}
}
示例2: drive_get_misc_functions
void drive_get_misc_functions()
{
try {
// Get function tests
CQLValue a1(Uint64(123));
CQLValue a2(Sint64(-123));
CQLValue a3(Real64(25.24));
CQLValue a4(String("Hellow"));
CQLValue a5(Boolean(true));
String _date("20040811105625.000000-360");
CIMDateTime date(_date);
CQLValue a6(date);
String _date1("20040811105626.000000-360");
CIMDateTime date1(_date1);
CQLValue a61(date1);
String opStr("MyClass.z=true,y=1234,x=\"Hello World\"");
CIMObjectPath op(opStr);
CQLValue a7(op);
const CIMName _cimName(String("CIM_OperatingSystem"));
CIMInstance _i1(_cimName);
CQLValue a8(_i1);
PEGASUS_TEST_ASSERT(a1.getUint() == Uint64(123));
PEGASUS_TEST_ASSERT(a2.getSint() == Sint64(-123));
PEGASUS_TEST_ASSERT(a3.getReal() == Real64(25.24));
PEGASUS_TEST_ASSERT(a4.getString() == String("Hellow"));
PEGASUS_TEST_ASSERT(a5.getBool() == Boolean(true));
PEGASUS_TEST_ASSERT(a6.getDateTime() == CIMDateTime(_date));
PEGASUS_TEST_ASSERT(a6 != a61);
PEGASUS_TEST_ASSERT(a6 < a61);
PEGASUS_TEST_ASSERT(a7.getReference() ==
CIMObjectPath(opStr));
try
{
a1.getSint();
PEGASUS_TEST_ASSERT(0);
}
catch(...)
{
PEGASUS_TEST_ASSERT(1);
}
}
catch(Exception & e)
{
cout << e.getMessage() << endl;
PEGASUS_TEST_ASSERT(0);
}
return;
}
示例3: Boolean
Boolean TInputLine::canScroll( int delta )
{
if( delta < 0 )
return Boolean( firstPos > 0 );
else
if( delta > 0 )
return Boolean( strlen(data) - firstPos + 2 > size.x );
else
return False;
}
示例4: WindowHint
static int WindowHint(lua_State *L)
{
int target = checktarget(L, 1);
switch(target)
{
case GLFW_RESIZABLE:
case GLFW_VISIBLE:
case GLFW_DECORATED:
case GLFW_FOCUSED:
case GLFW_AUTO_ICONIFY:
case GLFW_FLOATING:
case GLFW_MAXIMIZED:
case GLFW_CENTER_CURSOR:
case GLFW_TRANSPARENT_FRAMEBUFFER:
case GLFW_HOVERED:
case GLFW_FOCUS_ON_SHOW:
case GLFW_SCALE_TO_MONITOR: return Boolean(L, target);
case GLFW_RED_BITS:
case GLFW_GREEN_BITS:
case GLFW_BLUE_BITS:
case GLFW_ALPHA_BITS:
case GLFW_DEPTH_BITS:
case GLFW_STENCIL_BITS:
case GLFW_ACCUM_RED_BITS:
case GLFW_ACCUM_GREEN_BITS:
case GLFW_ACCUM_BLUE_BITS:
case GLFW_ACCUM_ALPHA_BITS:
case GLFW_AUX_BUFFERS:
case GLFW_SAMPLES:
case GLFW_REFRESH_RATE: return Integer(L, target);
case GLFW_STEREO:
case GLFW_SRGB_CAPABLE:
case GLFW_DOUBLEBUFFER: return Boolean(L, target);
case GLFW_CLIENT_API: ENUM(L, target, checkapi);
case GLFW_CONTEXT_CREATION_API: ENUM(L, target, checkcontextcreationapi);
case GLFW_CONTEXT_VERSION_MAJOR:
case GLFW_CONTEXT_VERSION_MINOR: return Integer(L, target);
case GLFW_CONTEXT_ROBUSTNESS: ENUM(L, target, checkrobustness);
case GLFW_CONTEXT_RELEASE_BEHAVIOR: ENUM(L, target, checkreleasebehavior);
case GLFW_OPENGL_FORWARD_COMPAT:
case GLFW_OPENGL_DEBUG_CONTEXT: return Boolean(L, target);
case GLFW_OPENGL_PROFILE: ENUM(L, target, checkprofile);
case GLFW_X11_CLASS_NAME:
case GLFW_X11_INSTANCE_NAME: return String(L, target);
default:
return luaL_error(L, "invalid target '%s'", lua_tostring(L, 1));
}
return 0;
}
示例5: setCmdState
void TEditor::updateCommands()
{
setCmdState( cmUndo, Boolean( delCount != 0 || insCount != 0 ) );
if( isClipboard() == False )
{
setCmdState(cmCut, hasSelection());
setCmdState(cmCopy, hasSelection());
setCmdState(cmPaste,
Boolean(clipboard != 0 && (clipboard->hasSelection())) );
}
setCmdState(cmClear, hasSelection());
setCmdState(cmFind, True);
setCmdState(cmReplace, True);
setCmdState(cmSearchAgain, True);
}
示例6: HQWrappedPictureIO
std::ostream& HQWrappedPictureIO(std::ostream& stream, const WrappedPicture& d) {
std::ostringstream ss;
ss.copyfmt(stream);
// Picture Header
ss << Bytes(4, d.picture_number);
// Transform Params
ss << vlc::unbounded
<< UnsignedVLC(d.wavelet_kernel)
<< UnsignedVLC(d.depth)
<< UnsignedVLC(d.slices_x)
<< UnsignedVLC(d.slices_y)
<< UnsignedVLC(d.slice_prefix)
<< UnsignedVLC(d.slice_size_scalar)
<< Boolean(false)
<< vlc::align;
// Transform Data
ss << d.slices;
stream << ParseInfoIO(HQ_PICTURE, ss.str().size());
return (stream << ss.str());
}
示例7: while
TMenu *TMenuView::readMenu( ipstream& is )
{
TMenu *menu = new TMenu;
TMenuItem **last = &(menu->items);
TMenuItem *item = 0;
uchar tok;
is >> tok;
while( tok != 0 )
{
assert( tok == 0xFF );
item = new TMenuItem( 0, 0, (void *)0 );
*last = item;
last = &(item->next);
item->name = is.readString();
int temp;
is >> item->command >> temp
>> item->keyCode >> item->helpCtx;
item->disabled = Boolean( temp );
if( item->name != 0 )
{
if( item->command == 0 )
item->subMenu = readMenu( is );
else
item->param = is.readString();
}
is >> tok;
}
*last = 0;
menu->deflt = menu->items;
return menu;
}
示例8: TNode
TNode *TOutline::readNode(ipstream &ip) {
int nChildren;
uchar more;
uchar expand;
TNode *node = new TNode((char *)0);
ip >> more;
ip >> expand;
ip >> nChildren;
node->text = ip.readString();
node->expanded = Boolean(expand);
if (nChildren)
node->childList = readNode(ip);
else
node->childList = 0;
if (more)
node->next = readNode(ip);
else
node->next = 0;
return node;
}
示例9: clearEvent
void TLabel::handleEvent( TEvent& event )
{
TStaticText::handleEvent(event);
if( event.what == evMouseDown )
{
if( link != 0 )
link->select();
clearEvent( event );
}
else if( event.what == evKeyDown )
{
char c = hotKey( text );
if( getAltCode(c) == event.keyDown.keyCode ||
( c != 0 && owner->phase == TGroup::phPostProcess &&
toupper(event.keyDown.charScan.charCode) == c )
)
{
if (link != 0 )
link->select();
clearEvent( event );
}
}
else if( event.what == evBroadcast &&
( event.message.command == cmReceivedFocus ||
event.message.command == cmReleasedFocus )
)
{
light = Boolean( (link->state & sfFocused) != 0 );
drawView();
}
}
示例10: main
int main(int argc, char** argv)
{
try
{
const String NAMESPACE = "/ggg";
SimpleDeclContext context;
CIMClass x(CIMName ("X"));
x.addProperty(CIMProperty(CIMName ("one"), Uint32(111)));
x.addProperty(CIMProperty(CIMName ("two"), Real32(222.222)));
x.addProperty(CIMProperty(CIMName ("three"), String("Three")));
context.addClass(NAMESPACE, x);
Resolver::resolveClass (x, &context, NAMESPACE);
CIMClass y(CIMName ("Y"), CIMName ("X"));
y.addProperty(CIMProperty(CIMName ("three"), String("Three - Three")));
y.addProperty(CIMProperty(CIMName ("four"), Boolean(false)));
y.addProperty(CIMProperty(CIMName ("five"), Real32(555.555)));
context.addClass(NAMESPACE, y);
Resolver::resolveClass (y, &context, NAMESPACE);
// y.print();
}
catch (Exception& e)
{
cout << "Exception: " << e.getMessage() << endl;
}
cout << argv[0] << " +++++ passed all tests" << endl;
return 0;
}
示例11: Boolean
void *TEditor::read( ipstream& is )
{
TView::read( is );
int temp;
is >> hScrollBar >> vScrollBar >> indicator
>> bufSize >> temp;
canUndo = Boolean(temp);
selecting = False;
overwrite = False;
autoIndent = False;
lockCount = 0;
keyState = 0;
initBuffer();
if( buffer != 0 )
isValid = True;
else
{
TEditor::editorDialog( edOutOfMemory, 0 );
bufSize = 0;
}
lockCount = 0;
lock();
setBufLen( 0 );
return this;
}
示例12: scan
Boolean TEditor::search( const char *findStr, ushort opts )
{
ushort pos = curPtr;
ushort i;
do {
if( (opts & efCaseSensitive) != 0 )
i = scan( &buffer[bufPtr(pos)], bufLen - pos, findStr);
else
i = iScan( &buffer[bufPtr(pos)], bufLen - pos, findStr);
if( i != sfSearchFailed )
{
i += pos;
if( (opts & efWholeWordsOnly) == 0 ||
!(
( i != 0 && isWordChar(bufChar(i - 1)) != 0 ) ||
( i + strlen(findStr) != bufLen &&
isWordChar(bufChar(i + strlen(findStr)))
)
))
{
lock();
setSelect(i, i + strlen(findStr), False);
trackCursor(Boolean(!cursorVisible()));
unlock();
return True;
}
else
pos = i + 1;
}
} while( i != sfSearchFailed );
return False;
}
示例13: Boolean
void *TSortedCollection::read( ipstream& is )
{
TCollection::read( is );
int temp;
is >> temp;
duplicates = Boolean(temp);
return this;
}
示例14: driveValid
Boolean driveValid(char drive) {
drive = toupper(drive);
#ifdef __MSDOS__
struct diskfree_t df;
return Boolean(_dos_getdiskfree(drive-'@',&df) == 0);
#elif defined(__OS2__)
FSALLOCATE a;
return Boolean(!DosQueryFSInfo(drive - '@', FSIL_ALLOC, &a, sizeof(a)));
#elif defined(__NT__)
DWORD mask = 0x01 << (drive - 'A');
return (Boolean)(GetLogicalDrives() & mask);
#elif defined(__QSINIT__)
return (Boolean)(io_ismounted(drive - 'A', 0));
#else
#error Unknown platform!
#endif
}
示例15: long
Boolean TTerminal::canInsert( ushort amount )
{
long T = (queFront < queBack) ?
( queFront + amount ) :
( long(queFront) - bufSize + amount); // cast needed so we get
// signed comparison
return Boolean( queBack > T );
}