本文整理汇总了C++中QCString::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QCString::append方法的具体用法?C++ QCString::append怎么用?C++ QCString::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCString
的用法示例。
在下文中一共展示了QCString::append方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendExitCode
void ConnectionHandler::sendExitCode()
{
if(!m_needExitCode)
return;
QCString buf;
buf.setNum(m_exitCode);
buf.prepend("OK ");
buf.append("\n");
send(m_Fd, buf.data(), buf.length(), 0);
}
示例2: kdDebug
Q_LONG
CDDBPLookup::writeLine( const QString & line )
{
if ( !isConnected() )
{
kdDebug(60010) << "socket status: " << socket_->state() << endl;
return -1;
}
kdDebug(60010) << "WRITE: [" << line << "]" << endl;
QCString buf = line.utf8();
buf.append( "\n" );
return socket_->writeBlock( buf.data(), buf.length() );
}
示例3: escape
QCString KDEsuClient::escape(const QCString &str)
{
QCString copy = str;
int n = 0;
while((n = copy.find("\\", n)) != -1)
{
copy.insert(n, '\\');
n += 2;
}
n = 0;
while((n = copy.find("\"", n)) != -1)
{
copy.insert(n, '\\');
n += 2;
}
copy.prepend("\"");
copy.append("\"");
return copy;
}
示例4: shutdown
void DM::shutdown(KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, /* NOT Default */
const QString &bootOption)
{
if(shutdownType == KApplication::ShutdownTypeNone)
return;
bool cap_ask;
if(DMType == NewKDM)
{
QCString re;
cap_ask = exec("caps\n", re) && re.find("\tshutdown ask") >= 0;
}
else
{
if(!bootOption.isEmpty())
return;
cap_ask = false;
}
if(!cap_ask && shutdownMode == KApplication::ShutdownModeInteractive)
shutdownMode = KApplication::ShutdownModeForceNow;
QCString cmd;
if(DMType == GDM)
{
cmd.append(shutdownMode == KApplication::ShutdownModeForceNow ? "SET_LOGOUT_ACTION " : "SET_SAFE_LOGOUT_ACTION ");
cmd.append(shutdownType == KApplication::ShutdownTypeReboot ? "REBOOT\n" : "HALT\n");
}
else
{
cmd.append("shutdown\t");
cmd.append(shutdownType == KApplication::ShutdownTypeReboot ? "reboot\t" : "halt\t");
if(!bootOption.isEmpty())
cmd.append("=").append(bootOption.local8Bit()).append("\t");
cmd.append(shutdownMode == KApplication::ShutdownModeInteractive ? "ask\n" : shutdownMode == KApplication::ShutdownModeForceNow
? "forcenow\n"
: shutdownMode == KApplication::ShutdownModeTryNow
? "trynow\n"
: "schedule\n");
}
exec(cmd.data());
}
示例5: generateDEFForMember
void generateDEFForMember(MemberDef *md,
FTextStream &t,
Definition *def,
const char* Prefix)
{
QCString memPrefix;
// + declaration
// - reimplements
// - reimplementedBy
// - exceptions
// - const/volatile specifiers
// - examples
// + source definition
// - source references
// - source referenced by
// - include code
if (md->memberType()==MemberDef::EnumValue) return;
QCString scopeName;
if (md->getClassDef())
scopeName=md->getClassDef()->name();
else if (md->getNamespaceDef())
scopeName=md->getNamespaceDef()->name();
t << " " << Prefix << "-member = {" << endl;
memPrefix = " ";
memPrefix.append( Prefix );
memPrefix.append( "-mem-" );
QCString memType;
bool isFunc=FALSE;
switch (md->memberType())
{
case MemberDef::Define: memType="define"; break;
case MemberDef::EnumValue: ASSERT(0); break;
case MemberDef::Property: memType="property"; break;
case MemberDef::Event: memType="event"; break;
case MemberDef::Variable: memType="variable"; break;
case MemberDef::Typedef: memType="typedef"; break;
case MemberDef::Enumeration: memType="enum"; break;
case MemberDef::Function: memType="function"; isFunc=TRUE; break;
case MemberDef::Signal: memType="signal"; isFunc=TRUE; break;
case MemberDef::Friend: memType="friend"; isFunc=TRUE; break;
case MemberDef::DCOP: memType="dcop"; isFunc=TRUE; break;
case MemberDef::Slot: memType="slot"; isFunc=TRUE; break;
}
t << memPrefix << "kind = '" << memType << "';" << endl;
t << memPrefix << "id = '"
<< md->getOutputFileBase() << "_1" << md->anchor()
<< "';" << endl;
t << memPrefix << "virt = ";
switch (md->virtualness())
{
case Normal: t << "normal;" << endl; break;
case Virtual: t << "virtual;" << endl; break;
case Pure: t << "pure-virtual;" << endl; break;
default: ASSERT(0);
}
t << memPrefix << "prot = ";
switch(md->protection())
{
case Public: t << "public;" << endl; break;
case Protected: t << "protected;" << endl; break;
case Private: t << "private;" << endl; break;
case Package: t << "package;" << endl; break;
}
if (md->memberType()!=MemberDef::Define &&
md->memberType()!=MemberDef::Enumeration
)
{
QCString typeStr = replaceAnonymousScopes(md->typeString());
t << memPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl << typeStr << endl
<< "_EnD_oF_dEf_TeXt_;" << endl;
}
t << memPrefix << "name = '" << md->name() << "';" << endl;
if (isFunc) //function
{
ArgumentList *declAl = new ArgumentList;
LockingPtr<ArgumentList> defAl = md->argumentList();
stringToArgumentList(md->argsString(),declAl);
QCString fcnPrefix = " " + memPrefix + "param-";
if (declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Argument *a;
for (declAli.toFirst();(a=declAli.current());++declAli)
{
Argument *defArg = defAli.current();
t << memPrefix << "param = {" << endl;
if (!a->attrib.isEmpty())
//.........这里部分代码省略.........
示例6: saveInstance
void Small::saveInstance(){
QCString store;
QCString temp;
store.append("MAX_CID=");
store.append(w->spinBox2->text());
store.append("\nMRRU=");
store.append(w->spinBox3->text());
store.append("\nLARGE_CID=");
if(w->checkBox1->isChecked())
store.append("YES");
else
store.append("NO");
store.append("\nCONNECTION_TYPE=");
// store.append(w->comboBox1->text(w->comboBox1->currentItem()));
// temp = new QCString();
// temp = w->comboBox1->currentItem();
temp.setNum(w->comboBox1->currentItem());
store.append(temp);
store.append("\nFEEDBACK_FREQ=");
temp.setNum(w->slider2->value());
store.append(temp);
store.append("\nROHC_ENABLE=");
if(w->checkBox2->isChecked())
store.append("YES\n");
else
store.append("NO\n");
// KMessageBox::information(this, store);
editMode(false);
w->pushButton2_2->setOn(false);
object->writeProc(store);
}
示例7: handleCommentBlock
void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
{
int position=0;
static bool isIn;
QCString doc;
doc.append(doc1);
// fprintf(stderr,"\n %s",doc.data());
if (doc.isEmpty()) return;
if (checkMultiComment(doc,yyLineNr))
{
strComment.resize(0);
return;
}
isIn=checkInlineCode(doc);
bool isEndCode=doc.contains("\\endcode");
// empty comment --!
if (isEndCode)
{
int end=inputString.find(doc.data(),iCodeLen);
makeInlineDoc(end);
strComment.resize(0);
isIn=false;
}
if (isIn)
{
isIn=false;
return;
}
VhdlDocGen::prepareComment(doc);
bool needsEntry=FALSE;
Protection protection=Public;
int lineNr;
if (iDocLine==-1)
lineNr=yyLineNr;
if (oldEntry==current)
{
//printf("\n find pending message < %s > at line: %d \n ",doc.data(),iDocLine);
str_doc.doc=doc;
str_doc.iDocLine=iDocLine;
str_doc.brief=brief;
str_doc.pending=TRUE;
return;
}
oldEntry=current;
if (brief)
{
current->briefLine = yyLineNr;
}
else
{
current->docLine = yyLineNr;
}
// printf("parseCommentBlock file<%s>\n [%s]\n at line [%d] \n ",yyFileName.data(),doc.data(),iDocLine);
int j=doc.find("[plant]");
if (j>=0)
{
doc=doc.remove(j,7);
current->stat=true;
}
while (parseCommentBlock(
g_thisParser,
current,
doc, // text
yyFileName, // file
iDocLine, // line of block start
brief,
0,
FALSE,
protection,
position,
needsEntry
)
)
{
//printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
if (needsEntry) newEntry();
}
if (needsEntry)
{
if (varr)
{
varr=FALSE;
current->name=varName;
current->section=Entry::VARIABLEDOC_SEC;
varName="";
}
newEntry();
}
iDocLine=-1;
strComment.resize(0);
}
示例8: set_cpp
void UmlOperation::set_cpp(const char * return_form_or_inherit,
const char * params, QCString body,
bool inlinep, const char * if_def,
const char * end_if) {
if (*return_form_or_inherit == ':') {
// inherit
if (inlinep) {
QCString s = remove_throw(CppSettings::operationDecl());
int index = s.find("${)}");
s.resize(index + 5);
s.insert(index, params);
s.append(" ");
s.append(return_form_or_inherit);
if (!body.isEmpty()) {
s.append(" {\n ");
s.append(body);
s.append("}\n");
}
else
s.append(" {\n}\n");
conditional(s, if_def, end_if);
set_CppDecl(s);
set_CppDef("");
}
else {
QCString s = remove_throw(CppSettings::operationDecl());
int index = s.find("${)}");
s.resize(index + 5);
s.insert(index, params);
s.append(";");
conditional(s, if_def, end_if);
set_CppDecl(s);
s = remove_throw(CppSettings::operationDef());
index = s.find("${)}");
s.resize(index + 5);
s.insert(index, params);
s.append(" ");
s.append(return_form_or_inherit);
if (!body.isEmpty()) {
s.append(" {\n ");
s.append(body);
s.append("}\n");
}
else
s.append(" {\n}\n");
conditional(s, if_def, end_if);
set_CppDef(s);
}
}
else {
// return
if (inlinep) {
QCString s = remove_throw(CppSettings::operationDecl());
int index = s.find("${type}");
s.replace(index, 7, return_form_or_inherit);
s.insert(s.find("${)}", index), params);
s.resize(s.findRev(";") + 1);
if (!body.isEmpty()) {
s.append(" {\n ");
s.append(body);
s.append("}\n");
}
else
s.append(" {\n}\n");
conditional(s, if_def, end_if);
set_CppDecl(s);
set_CppDef("");
}
else {
QCString s = remove_throw(CppSettings::operationDecl());
int index = s.find("${type}");
s.replace(index, 7, return_form_or_inherit);
s.insert(s.find("${)}", index), params);
conditional(s, if_def, end_if);
set_CppDecl(s);
s = remove_throw(CppSettings::operationDef());
index = s.find("${type}");
s.replace(index, 7, return_form_or_inherit);
s.insert(s.find("${)}", index), params);
conditional(s, if_def, end_if);
set_CppDef(s);
set_CppBody(body);
}
}
}