当前位置: 首页>>代码示例>>C++>>正文


C++ writeLine函数代码示例

本文整理汇总了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;
}
开发者ID:khaledhosny,项目名称:afdko,代码行数:28,代码来源:ufowrite.c

示例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;
}
开发者ID:lothar-mar,项目名称:epanet2-msx,代码行数:30,代码来源:msxrpt.c

示例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>"));
}
开发者ID:savant-nz,项目名称:carbon,代码行数:25,代码来源:Logfile.cpp

示例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;
}
开发者ID:sinoory,项目名称:webv8,代码行数:31,代码来源:NetscapePluginModuleX11.cpp

示例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;
}
开发者ID:AlexRu,项目名称:rosa-media-player,代码行数:35,代码来源:myclient.cpp

示例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);
}
开发者ID:darth-llamah,项目名称:gmenu2x,代码行数:8,代码来源:asfont.cpp

示例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");
  }
}
开发者ID:gitpan,项目名称:Device-Arduino-LCD,代码行数:59,代码来源:perlcd.cpp

示例8: clearScreen

void IOHelper::writeWelcome()
{
	clearScreen();
	writeLine("-------------------------------------------------------------");
	writeLine("|             Welcome to Dungeons & Dragons                 |");
	writeLine("|                                                           |");
	writeLine("|        Made by Wouter Aarts & Ben van Doormalen           |");
	writeLine("-------------------------------------------------------------");
}
开发者ID:Wmaarts,项目名称:Dungeons-Dragons,代码行数:9,代码来源:IOHelper.cpp

示例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");
	}
}
开发者ID:Ali-il,项目名称:gamekit,代码行数:10,代码来源:luOutputs.cpp

示例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++;
}
开发者ID:lothar-mar,项目名称:epanet2-msx,代码行数:12,代码来源:msxrpt.c

示例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, "\" />");
}
开发者ID:khaledhosny,项目名称:afdko,代码行数:13,代码来源:ufowrite.c

示例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;
}
开发者ID:fquiros,项目名称:CEO,代码行数:48,代码来源:gpuMemMonitor.cpp

示例13: writeLine

void QAtChat::performWakeup()
{
    d->wakeupInProgress = true;
    writeLine( d->wakeupCommand );
    d->lastSendTime.restart();
    QTimer::singleShot( 1000, this, SLOT(wakeupFinished()) );
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:7,代码来源:qatchat.cpp

示例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);
    }

}
开发者ID:Mikelle02,项目名称:GameMaker,代码行数:26,代码来源:TVGUID12.CPP

示例15: writeLine

bool ASTPrinter::visit(Identifier const& _node)
{
	writeLine(string("Identifier ") + _node.getName());
	printType(_node);
	printSourcePart(_node);
	return goDeeper();
}
开发者ID:1600,项目名称:solidity,代码行数:7,代码来源:ASTPrinter.cpp


注:本文中的writeLine函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。