本文整理汇总了C++中CLine::getServer方法的典型用法代码示例。如果您正苦于以下问题:C++ CLine::getServer方法的具体用法?C++ CLine::getServer怎么用?C++ CLine::getServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLine
的用法示例。
在下文中一共展示了CLine::getServer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addCLine
void CLineEditor::addCLine()
{
QString txt = QInputDialog::getText(this, tr("New CLine"), tr("Insert a CLine : \"C: server port user pass\"\nExample : \"C: server.org 12000 c9nypo abc123\""));
if(txt != "")
{
CLine cline = CLineFileParser::parseCLine(txt);
if(!cline.getServer().isEmpty())
model->addCline(cline);
}
}
示例2: createCCcamFile
void CLineEditor::createCCcamFile()
{
QFile src(remoteFileName + ".bak");
QFile dst(remoteFileName);
if(!src.open(QIODevice::ReadOnly | QIODevice::Text))
{
QMessageBox::critical(0,tr("Open fail"), tr("Failed to open : %1").arg(src.fileName()));
return;
}
if(!dst.open(QIODevice::WriteOnly | QIODevice::Text))
{
QMessageBox::critical(0,tr("Open fail"), tr("Failed to open : %1").arg(dst.fileName()));
return;
}
QTextStream out(&dst);
while (!src.atEnd())
{
QString line = src.readLine().trimmed();
CLine cline = CLineFileParser::parseCLine(line);
if(cline.getServer().isEmpty() && line != CLINE_EDITOR_HEADER)
out << line << "\n";
}
if(model->getClines().size() > 0)
out << CLINE_EDITOR_HEADER << "\n";
foreach (const CLine &cline, model->getClines())
out << cline.toString() << "\n";
src.close();
dst.close();
}