本文整理汇总了C++中writeLine函数的典型用法代码示例。如果您正苦于以下问题:C++ writeLine函数的具体用法?C++ writeLine怎么用?C++ writeLine使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeLine函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glyphEnd
/* End glyph definition. */
static void glyphEnd(abfGlyphCallbacks *cb) {
ufwCtx h = cb->direct_ctx;
if (h->err.code != 0)
return;
else if (h->path.state < 2) {
/* Call sequence error */
h->err.code = ufwErrBadCall;
return;
}
if (h->path.state >= 3) /* have seen a move to. */
writeContour(h);
if (h->path.state < 3) /* have NOT seen a move to, hence have never emitted an <outline> tag. */
writeLine(h, "\t<outline>");
writeLine(h, "\t</outline>");
writeLine(h, "</glyph>");
h->path.state = 0;
flushBuf(h);
/* Close dst stream */
h->cb.stm.close(&h->cb.stm, h->stm.dst);
return;
}
示例2: MSXrpt_write
int MSXrpt_write()
{
INT4 magic = 0;
int j;
int recordsize = sizeof(INT4);
// --- check that results are available
if ( MSX.Nperiods < 1 ) return 0;
if ( MSX.OutFile.file == NULL ) return ERR_OPEN_OUT_FILE;
fseek(MSX.OutFile.file, -recordsize, SEEK_END);
fread(&magic, sizeof(INT4), 1, MSX.OutFile.file);
if ( magic != MAGICNUMBER ) return ERR_IO_OUT_FILE;
// --- write program logo & project title
PageNum = 1;
LineNum = 1;
newPage();
for (j=0; j<=5; j++) writeLine(Logo[j]);
writeLine("");
writeLine(MSX.Title);
// --- generate the appropriate type of table
if ( MSX.Statflag == SERIES ) createSeriesTables();
else createStatsTables();
writeLine("");
return 0;
}
示例3: String
void Logfile::writeCollapsibleSection(const UnicodeString& title, const Vector<UnicodeString>& contents,
OutputType type, bool writeLineNumbers)
{
// Collapsible sections are done with an <a> tag that toggles the display style on a div holding the contents of the
// section. The toggleDivVisibility() JavaScript function used here is defined in Logfile::LogfileHeader.
static auto nextSectionID = 0U;
auto divID = String() + "collapsible-section-" + nextSectionID++;
m->writeRaw(UnicodeString() + "<div class='info'>[" + FileSystem::getShortDateTime() + "] " +
"<a href='javascript:;' onmousedown='toggleDivVisibility(\"" + divID + "\");'>" + title + "</a></div>" +
"<div id='" + divID +
"' style='display: none; padding-left: 5em; padding-top: 1em; padding-bottom: 1em;'>");
for (auto i = 0U; i < contents.size(); i++)
{
if (writeLineNumbers)
writeLine(String::Empty, (UnicodeString(i + 1) + ":").padToLength(10) + contents[i], type, false);
else
writeLine(String::Empty, contents[i], type, false);
}
m->writeRaw(String("</div>"));
}
示例4: writeLine
bool NetscapePluginModule::scanPlugin(const String& pluginPath)
{
RawPluginMetaData metaData;
{
// Don't allow the plugin to pollute the standard output.
StdoutDevNullRedirector stdOutRedirector;
// We are loading the plugin here since it does not seem to be a standardized way to
// get the needed informations from a UNIX plugin without loading it.
RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
if (!pluginModule)
return false;
pluginModule->incrementLoadCount();
bool success = pluginModule->getPluginInfoForLoadedPlugin(metaData);
pluginModule->decrementLoadCount();
if (!success)
return false;
}
// Write data to standard output for the UI process.
writeLine(metaData.name);
writeLine(metaData.description);
writeLine(metaData.mimeDescription);
fflush(stdout);
return true;
}
示例5: writeLine
bool MyClient::sendFiles( const QStringList & files, bool addToPlaylist)
{
QString line;
writeLine("open_files_start\r\n");
line = readLine();
if (!line.startsWith("OK")) return false;
for (int n=0; n < files.count(); n++)
{
writeLine("open_files " + files[n] + "\r\n");
line = readLine();
if (!line.startsWith("OK")) return false;
}
if (!addToPlaylist)
writeLine("open_files_end\r\n");
else
writeLine("add_files_end\r\n");
writeLine("quit\r\n");
do
{
line = readLine();
}
while (!line.isNull());
/*
socket->disconnectFromHost();
socket->waitForDisconnected( timeout );
*/
return true;
}
示例6: split
void ASFont::write(Surface* surface, const std::string& text, int x, int y, HAlign halign, VAlign valign) {
if (text.find("\n", 0) != std::string::npos) {
std::vector<std::string> textArr;
split(textArr, text, "\n");
writeLine(surface, textArr, x, y, halign, valign);
} else
writeLine(surface, text, x, y, halign, valign);
}
示例7: dispatchCommand
// do something...
void dispatchCommand() {
int commandNumber = atoi(commandBuffer);
if (DEBUG) {
Serial.print("command buffer is: "); Serial.println(commandBuffer);
Serial.println("accumulated data:"); Serial.println(dataBuffer);
}
int dataAsInt;
switch (commandNumber) {
case CLEAR:
clearLineHistory();
lcd.clear();
break;
case ROW_ONE_TEXT:
writeLine(1, dataBuffer);
break;
case ROW_TWO_TEXT:
writeLine(2, dataBuffer);
break;
case PLACE_STRING:
writeString(dataBuffer);
break;
case WRITE_ASCII:
writeAscii(dataBuffer);
break;
case SCROLL_LEFT:
dataAsInt = atoi(dataBuffer);
dataAsInt > 0 ? dataAsInt : DEFAULT_SCROLL_DELAY;
lcd.leftScroll(LINE_SIZE,
dataAsInt > 0 ? dataAsInt : DEFAULT_SCROLL_DELAY);
lcd.clear(); // should i or not?
break;
case SCROLL_UP:
writeLine(1, lineHistory[2]);
writeLine(2, dataBuffer);
break;
case MAKE_CHAR:
recvCharData();
break;
case SET_GAUGE:
setGauge();
break;
case SEND_CMD:
lcd.commandWrite(atoi(dataBuffer));
break;
case PRINT:
lcd.print(atoi(dataBuffer));
break;
case RESET:
clearLineHistory();
resetGauges();
lcd.clear();
break;
default:
lcd.clear();
lcd.printIn("Undef'd Command");
}
}
示例8: clearScreen
void IOHelper::writeWelcome()
{
clearScreen();
writeLine("-------------------------------------------------------------");
writeLine("| Welcome to Dungeons & Dragons |");
writeLine("| |");
writeLine("| Made by Wouter Aarts & Ben van Doormalen |");
writeLine("-------------------------------------------------------------");
}
示例9: runCmd
void luConsoleEdit::runCmd(const wxString& cmd, bool prompt, bool echo)
{
if (echo) writeLine(cmd + "\n");
if (prompt) writeLine(m_prompt);
if (m_script)
{
m_script->call(WX2GK(cmd), "console");
}
}
示例10: newPage
void newPage()
{
char s[MAXLINE+1];
LineNum = 1;
sprintf(s,
"\nPage %-3d EPANET-MSX 1.1", //1.1.00
PageNum);
writeLine(s);
writeLine("");
if ( PageNum > 1 ) writeTableHdr();
PageNum++;
}
示例11: writeGlyphFinalCurve
static void writeGlyphFinalCurve(ufwCtx h, float *coords) {
writeStr(h, "\t\t\t<point x=\"");
writeReal(h, coords[0]);
writeStr(h, "\" y=\"");
writeReal(h, coords[1]);
writeLine(h, "\" />");
writeStr(h, "\t\t\t<point x=\"");
writeReal(h, coords[2]);
writeStr(h, "\" y=\"");
writeReal(h, coords[3]);
writeLine(h, "\" />");
}
示例12: main
int main(int argc, char **argv)
{
cudaError_t err = cudaSuccess;
int deviceCount = 0;
size_t totalDevMem, freeDevMem;
size_t lastLineLength = 0; // MUST be initialized to zero
signal(SIGTERM, signalHandler);
signal(SIGQUIT, signalHandler);
signal(SIGINT, signalHandler);
signal(SIGHUP, signalHandler);
writeLine(lastLineLength, "Preparing...");
err = cudaGetDeviceCount(&deviceCount);
if (err != cudaSuccess) {
std::cerr << "ERROR: " << cudaGetErrorString(err) << std::endl;
}
while (err == cudaSuccess && gRun) {
std::ostringstream stream;
for (int i=0; i < deviceCount; ++i) {
if (err == cudaSuccess) {
err = cudaSetDevice(i);
if (err == cudaSuccess) {
cudaMemGetInfo(&freeDevMem, &totalDevMem);
if (i != 0)
stream << " : ";
stream << "Dev " << i << " (" << (freeDevMem/1024) << " KB of " << (totalDevMem/1048576) << " MB free)";
}
}
}
if (err == cudaSuccess) {
writeLine(lastLineLength, stream.str());
}
sleep(5); // TODO - make the cycle time an optional command line flag...
}
cudaThreadExit();
std::cout << std::endl;
return 0;
}
示例13: writeLine
void QAtChat::performWakeup()
{
d->wakeupInProgress = true;
writeLine( d->wakeupCommand );
d->lastSendTime.restart();
QTimer::singleShot( 1000, this, SLOT(wakeupFinished()) );
}
示例14: getColor
void TInterior::draw() // modified for scroller
{
ushort color = getColor(0x0301);
for( int i = 0; i < size.y; i++ )
// for each line:
{
TDrawBuffer b;
b.moveChar( 0, ' ', color, size.x );
// fill line buffer with spaces
int j = delta.y + i; // delta is scroller offset
if( j < lineCount && lines[j] != 0 )
{
char s[maxLineLength];
if( delta.x > strlen(lines[j] ) )
s[0] = EOS;
else
{
strncpy( s, lines[j]+delta.x, size.x );
s[size.x] = EOS;
}
b.moveCStr( 0, s, color );
}
writeLine( 0, i, size.x, 1, b);
}
}
示例15: writeLine
bool ASTPrinter::visit(Identifier const& _node)
{
writeLine(string("Identifier ") + _node.getName());
printType(_node);
printSourcePart(_node);
return goDeeper();
}