本文整理汇总了C++中WString::gets方法的典型用法代码示例。如果您正苦于以下问题:C++ WString::gets方法的具体用法?C++ WString::gets怎么用?C++ WString::gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WString
的用法示例。
在下文中一共展示了WString::gets方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sibWidth
void TreeNode::sibWidth()
//-----------------------
{
WString msg;
TreeNode * node;
int i;
bool sepInc = true;
msg.concatf( "%s: _sibWidth = %ld; parents: ",
_nm ? _nm : "<>", _sibWidth );
for( i = 0; i < getCount( ParentList ); i += 1 ) {
node = getNode( ParentList, i );
msg.concatf( "%s: sibContrib() = %ld; ",
node->_nm ? node->_nm : "<>",
node->getSibContrib( this, sepInc ) );
}
msg.concat( "children: " );
for( i = 0; i < getCount( ChildList ); i += 1 ) {
node = getNode( ChildList, i );
msg.concatf( "%s: _sibWidth = %ld; ",
node->_nm ? node->_nm : "<>", node->_sibWidth );
}
WMessageDialog::message( _parent, MsgPlain, MsgOk, msg.gets(),
"Source Browser" );
}
示例2: setEditorDLL
void Browse::setEditorDLL( const char * dll )
//-------------------------------------------
{
WString errMsg;
bool enable;
// the Goto-Definition item is enabled iff the Show-Detail is
enable = menuManager()->menuEnabled( MIMenuID( MMDetail, DMDetail ) );
_editorDLLName = dll;
delete _editorDLL;
_editorDLL = new WEditDLL;
_editorDLL->LoadDll( _editorDLLName, &errMsg );
if( !_editorDLL->isInitialized() ) {
WMessageDialog::messagef( this, MsgError, MsgOk,
BrowseTitle, errMsg.gets() );
delete _editorDLL;
_editorDLL = NULL;
enable = false;
}
menuManager()->enableMenu( MIMenuID( MMDetail, DMDefinition ), enable );
}
示例3: updateCurOs
void VCompDialog::updateCurOs( void )
{
MTarget *curtarg;
int pos;
WString curname;
int i;
WPickList& targets = _config->targets();
int icount = _imagelist->count();
for( i=0; i < icount; i++ ) {
_imagelist->deleteString( 0 );
}
pos = 0;
icount = targets.count();
_tgList.reset();
for( i=0; i< icount; i++ ) {
curtarg = (MTarget *)targets[i];
if( _cur_os == curtarg->targetOS() ) {
curname.printf( "%s [%s]", curtarg->imageName().gets(),
curtarg->tgtMask().ext() );
_imagelist->insertString( curname.gets(), pos );
_tgList.insertAt( pos, curtarg );
pos++;
}
}
}
示例4: findMatchingFile
static int findMatchingFile( HWND hwnd, const char *fname )
{
int rc;
WString fullname;
HWND lb;
getFullFname( hwnd, fname, &fullname );
lb = GetDlgItem( hwnd, FOD_FILELIST );
// fullname.toLower();
rc = (int)SendMessage( lb, LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)(LPSTR)fullname.gets() );
if( rc == LB_ERR ) {
getRelFname( hwnd, fname, &fullname );
// fullname.toLower();
rc = (int)SendMessage( lb, LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)(LPSTR)fullname.gets() );
}
return( rc );
}
示例5: initialize
void EdModule::initialize()
//-------------------------
{
WString s;
s.printf( "Modules for %s", _name );
setText( s.gets() );
EditModuleList::initialize();
}
示例6: getRelFname
static void getRelFname( HWND hwnd, const char *fname, WString *relname ) {
WString fullpath;
GetFilesInfo *info;
WFileName tgt;
WFileName filename;
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
info = (GetFilesInfo *)GET_DLGDATA( hwnd );
getFullFname( hwnd, fname, &fullpath );
filename = fullpath.gets();
_splitpath( info->tgt_file, drive, dir, NULL, NULL );
if( !stricmp( drive, filename.drive() ) ) {
formRelDir( filename.dir(), dir, relname );
relname->concat( filename.fName() );
relname->concat( filename.ext() );
} else {
*relname = fullpath.gets();
}
}
示例7: load
void DTViewClass::load()
//----------------------
{
WVList dataMembers;
WVList methods;
WVList friends;
int i;
WString str;
ClassType * cls = (ClassType *) _symbol;
Symbol * s;
_members->clearAndDestroy();
cls->dataMembers( dataMembers );
cls->memberFunctions( methods );
cls->friendFunctions( friends );
for( i = 0; i < friends.count(); i += 1 ) {
s = (Symbol *) friends[ i ];
str.printf( " friend %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
for( i = 0; i < dataMembers.count(); i += 1 ) {
s = (Symbol *) dataMembers[ i ];
str.printf( " %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
for( i = 0; i < methods.count(); i += 1 ) {
s = (Symbol *) methods[ i ];
str.printf( " %s;", s->scopedName( FALSE ) );
_members->insert( new ClassMember( s, str.gets() ) );
}
addDescriptions();
fillBox();
}
示例8: searchHook
static bool searchHook( dr_sym_context * symctxt, void *data )
//------------------------------------------------------------
{
FindSymData * info;
bool accept;
Symbol * sym;
info = (FindSymData *) data;
if( symctxt->name == NULL ) {
symctxt->name = DRGetName( symctxt->handle );
}
accept = info->keysym->matches( symctxt );
if( accept ) {
if( info->numItems == 0 ) {
WBRFree( symctxt->name );
symctxt->name = NULL;
info->context = new SearchContext( *symctxt->context );
return false; // <----- early return -- stop search
}
if( info->numItems > 0 ) {
info->numItems -= 1;
}
sym = Symbol::defineSymbol( symctxt->type, symctxt->handle,
symctxt->context->classhdl,
info->call_module,
symctxt->name );
info->data->add( sym );
#if DEBUG
if( !(info->data->count() % 10) ) {
WString stat;
stat.printf( "Loading - %d found", info->data->count() );
browseTop->statusText( stat.gets() );
}
#endif
} else {
WBRFree( symctxt->name );
}
return true; // continue searching
}
示例9: runCmd
void VMsgLog::runCmd( WString &cmd )
{
static char buff[MAX_BUFF+1];
addLine( cmd );
blength = 0;
buffer[blength] = '\0';
if( !_batserv ) {
#ifdef __WINDOWS__
VxDPut( cmd.gets(), cmd.size() + 1 );
for(;;) {
int len = VxDGet( buff, MAX_BUFF );
buff[len] = '\0';
if( streq( buff, TERMINATE_COMMAND_STR ) ) {
break;
} else if( len > 0 ) {
scanLine( buff, len );
}
}
#endif
} else {
unsigned maxlen;
maxlen = BatchMaxCmdLine();
cmd.truncate( maxlen );
BatchSpawn( cmd );
for( ;; ) {
WSystemService::sysYield(); //allow other tasks to run
unsigned long stat;
int len = BatchCollect( buff, MAX_BUFF, &stat );
if( len < 0 ) {
break;
} else if( len > 0 ) {
scanLine( buff, len );
}
}
}
if( strlen( buffer ) > 0 ) {
addLine( buffer );
}
}
示例10: okButton
void QueryConfig::okButton( WWindow * )
//-------------------------------------
{
WString str;
_symName->getCommand( str );
if( str.size() > 0 ) {
WString * addStr = new WString( str );
if( !_searchStrings->find( addStr ) ) {
_searchStrings->insertAt( 0, addStr );
}
}
WBRWinBase::optManager()->setIgnoreCase( !_matchCase->checked() );
WBRWinBase::optManager()->setWholeWord( _wholeWord->checked() );
WBRWinBase::optManager()->setUseRX(_useRX->checked() );
_filter->setName( str.gets() ); // setName _after_ options set!
// NYI -- file stuff
quit( TRUE );
}
示例11: DescriptionPart
DescriptionPaint::DescriptionPaint( WBRWindow * prnt, const WRect & r,
Symbol * sym )
: _parent( prnt )
, _rect( r )
, _current( -1 )
//--------------------------------------------------------------------
{
int i;
WVList desc;
Description * entry;
WString buf;
const char * uDefSymName;
int x = r.x();
int w;
int h;
_parts = new WCPtrOrderedVector<DescriptionPart>;
sym->description( desc );
for( i = 0; i < desc.count(); i += 1 ) {
entry = (Description *) desc[i];
if( entry->symbol() ) {
if( sym->isEqual( entry->symbol() ) ) {
// don't hilight the symbol we're describing
buf.concat( entry->name() );
delete entry->symbol();
} else {
if( buf != "" ) { // flush buf
w = prnt->getTextExtentX( buf );
h = prnt->getTextExtentY( buf );
_parts->append( new DescriptionPart( buf.gets(), NULL,
WRect(x,r.y(),w, h ) ) );
buf="";
x+=w;
}
uDefSymName = entry->name();
w = prnt->getTextExtentX( uDefSymName );
h = prnt->getTextExtentY( uDefSymName );
_parts->append( new DescriptionPart( uDefSymName,
entry->symbol(),
WRect(x,r.y(),w, h ) ) );
x+=w;
}
} else {
buf.concat( entry->name() );
}
}
desc.deleteContents();
if( buf != "" ) { // flush buf
w = prnt->getTextExtentX( buf );
h = prnt->getTextExtentY( buf );
_parts->append( new DescriptionPart( buf, NULL,
WRect(x,r.y(),w, h ) ) );
buf="";
x+=w;
}
_rect.w( x - abs( _rect.x() ) );
}
示例12: TreeFuncHook
bool TreeFuncNode::TreeFuncHook( drmem_hdl owner, dr_ref_info * ref,
char* ownerName, void * info )
//------------------------------------------------------------------
// this function really needs to be split up
{
int parentIndex;
int parentRoot;
TreeFuncNode * parent = NULL;
int childIndex;
int childRoot;
TreeFuncNode * child = NULL;
FuncSearchData* data = (FuncSearchData *) info;
char * depName;
bool accept;
#if DEBUG
data->funcsFound += 1;
if( !(data->funcsFound % 10) ) {
WString stat;
stat.printf( "Loading - %d found", data->funcsFound );
browseTop->statusText( stat.gets() );
}
#endif
// find if the symbol matches the filter
depName = DRGetName( ref->dependent );
accept = data->key->matches( ref->dependent, depName );
WBRFree( depName ); // OPTIMIZE -- could use this later
if( !accept ) {
return true; // <---- early return -- discard symbol, keep looking
}
for( int i = data->roots->count(); i > 0; i -= 1 ) {
TreeFuncNode * rt = (TreeFuncNode*) (*data->roots)[ i - 1 ];
parentIndex = rt->findNode( owner );
if( !parent ) {
if( parentIndex >= 0 ) {
parent = (TreeFuncNode *)(*rt->_flatNodes)[ parentIndex ];
parentRoot = i - 1;
}
}
if( !child ) {
childIndex = rt->findNode( ref->dependent );
if( childIndex >= 0 ) {
child = (TreeFuncNode *)(*rt->_flatNodes)[ childIndex ];
childRoot = i - 1;
}
}
if( child != NULL && parent != NULL ) {
break;
}
}
if( child != NULL && parent != NULL ) {
WBRFree( ownerName );
if( parentRoot == childRoot ) {
int prtIdx = child->findParent( parent );
if( prtIdx < 0 ) {
if( ref->dependent == owner ) { // direct recursion -- a->a
bool inReferences = false;
for( int refIdx = 0; refIdx < child->_flatReferences->count(); refIdx += 1 ) {
if( (*child->_flatReferences)[ refIdx ]->getHandle() == owner ) {
TreeNode * node = (*child->_flatReferences)[ refIdx ];
for( int ref2idx = 0; ref2idx < node->getCount( ParentList ); ref2idx += 1 ) {
if( node->getNode( ParentList, ref2idx )->getHandle() == owner ) {
TreePtr * ptr = node->getPtr( ParentList, ref2idx );
((TreeRefPtr*)ptr)->incRefs();
inReferences = true;
break;
}
}
}
if( inReferences ) {
break;
}
}
if( !inReferences ) {
TreeRefNode * newRef;
newRef = new TreeRefNode( data->parentWin, parent, parent );
parent->_children.add( newRef );
parent->_hasRef = true;
parent->_flatReferences->add( newRef );
}
} else {
parent->_children.add( child );
child->_parents.add(
new TreeFuncPtr( data->parentWin, child, parent, *ref ) );
}
} else {
TreePtr * ptr = child->getPtr( ParentList, prtIdx );
//.........这里部分代码省略.........
示例13: initialize
void DTViewSymbol::initialize()
//-----------------------------
// create the detail view of the symbol and size it.
{
WString titleText;
WRect tmpRect;
char fName[_MAX_PATH];
int width;
int tmpWidth;
int height;
rescale();
//----------------- "Function initialize" title ----------------
titleText.printf( "%s %s", SymbolTitleText[ _symbol->symtype() ],
_symbol->name() );
setText( titleText.gets() );
width = getTextExtentX( titleText.gets() ) + CaptionGadgetSize;
//---------- "Defined: D:\dev\browser\cpp\dtvsym.cpp" line ----------
if( _symbol->defSourceFile( fName ) ) {
_fileText.printf( "%s: %s", (_symbol->isDefined()) ? Defined : Declared, fName );
height = _symbolLineR.r.y();
} else {
height = _fileNameR.r.y();
}
tmpWidth = _fileNameR.r.x() + abs( _fileNameR.r.w() ) +
getTextExtentX( _fileText.gets() );
width = maxInt( width, tmpWidth );
//------- "void DTViewSymbol::initialize()" line -------
tmpRect = _symbolLineR.r;
tmpRect.y( height );
_descPaint = new DescriptionPaint( this, tmpRect, _symbol );
height += _symbolBoxR.r.y() - _symbolLineR.r.y();
tmpWidth = _symbolLineR.r.x() + _descPaint->rect().w() + abs( _symbolLineR.r.w() );
width = maxInt( width, tmpWidth );
//------------------ member listbox --------------------
if( _useBox ) {
tmpRect = _symbolBoxR.r;
tmpRect.y( height );
_symbolBox = new WListBox( this, tmpRect,
LStyleNoIntegral | WStyleHScroll | WStyleVScroll );
_symbolBox->show();
_symbolBox->setFocus();
height += __frame.r.h() - _symbolBoxR.r.y(); // this include 2 * dialogFrameHeight
}
width += 2 * WSystemMetrics::dialogFrameWidth();
height += WSystemMetrics::captionSize();
size( width, height );
show();
}