コード例 #1
0
ファイル: iso8211_simple.cpp プロジェクト: KaiAbuSir/EncLib
/*!
* Rem: "field001size" is field size including Terminator (FT)
* Writes the recId and the FT (Field Terminator)
* Returns pointer to first Byte after leader
***************************************************************************** */
void ISO8211::write0001fieldASC(QTextStream & iso8211strm, unsigned int iso8211rcid, unsigned int field001size) 
{
    iso8211strm.setFieldWidth(field001size -1);
    iso8211strm.setPadChar(QChar('0'));
    iso8211strm << iso8211rcid;
    iso8211strm.setFieldWidth(0);
    iso8211strm.setPadChar(QChar(' '));
    iso8211strm <<  ISO8211::FT;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: OdyX/Generatorrunner
static void printOptions(QTextStream& s, const QMap<QString, QString>& options) {
    QMap<QString, QString>::const_iterator it = options.constBegin();
    s.setFieldAlignment(QTextStream::AlignLeft);
    for (; it != options.constEnd(); ++it) {
        s << "  --";
        s.setFieldWidth(38);
        s << it.key() << it.value();
        s.setFieldWidth(0);
        s << endl;
    }
}
コード例 #3
0
ファイル: consoleoutput.cpp プロジェクト: wulffern/ciccreator
void ConsoleOutput::startComment(QTextStream &out,AnsiColor color){
  out.setFieldWidth(indent);
  out.setFieldAlignment(QTextStream::AlignRight);
  out << " ";
  out.setFieldWidth(0);
#ifndef _WIN32
  out << "\033[0;" << color << "m";
#endif
  out.setFieldAlignment(QTextStream::AlignLeft);
  out.setFieldWidth(20);
  out.setPadChar(' ');
}
コード例 #4
0
ファイル: qwscommand_qws.cpp プロジェクト: wpbest/copperspice
void QWSHexDump::hexDump()
{
    *outstrm << '(' << dataSize << " bytes):\n" << prefix;
    sprintf(sideviewLayout, " [%%-%us]", wrap);
    dataWidth = (2 * wrap) + (wrap / clustering);

    dirty = false;
    uint wrapIndex = 0;
    for (uint i = 0; i < dataSize; i++) {
        uint c = static_cast<uchar>(data[i]);
        sideview[wrapIndex = i%wrap] = isprint(c) ? c : '.';

        if (wrapIndex && (wrapIndex % clustering == 0))
            *outstrm << ' ';

        outstrm->setFieldWidth(2);
        outstrm->setPadChar('0');
        outstrm->setNumberFlags( QTextStream::ShowBase );
        *outstrm << hex << c;
        dirty = true;

        if (wrapIndex == wrap-1) {
            sideviewDump(wrapIndex);
            wrapIndex = 0;
            if (i+1 < dataSize)
                *outstrm << endl << prefix;
        }

    }
    sideviewDump(wrapIndex);
}
コード例 #5
0
ファイル: consoleoutput.cpp プロジェクト: wulffern/ciccreator
void ConsoleOutput::endComment(QTextStream &out){
  out.setFieldWidth(1);
#ifndef _WIN32
  out << "\033[0m" ;
#endif
  out << endl;
}
コード例 #6
0
// Write data + helpers
void FormattedTouchstone::WriteData(FormattedNetworkData &network, QTextStream &snpFile) {
    // Choose data format
    GetWriteFormat(network);

    snpFile.setRealNumberPrecision(PRECISION);
    for (uint currentFreq = 0; currentFreq < network.points(); currentFreq++) {
        snpFile.setFieldAlignment(QTextStream::AlignLeft);
        snpFile.setFieldWidth(COLUMNWIDTH);
        snpFile << network.x()[currentFreq];
        FormattedComplexMatrix2D::iterator row_iter = network.y()[currentFreq].begin();
        WriteRow(network, snpFile, *row_iter);
        row_iter++;
        for (; row_iter != network.y()[currentFreq].end(); row_iter++) {
            snpFile.setFieldAlignment(QTextStream::AlignLeft);
            snpFile.setFieldWidth(COLUMNWIDTH);
            snpFile << " "; // tab past frequency column for subsequent rows
            WriteRow(network, snpFile, *row_iter);
        }
    }
}
コード例 #7
0
ファイル: iso8211_simple.cpp プロジェクト: KaiAbuSir/EncLib
/*!
* Write the direcory of a S-57 Catalog-Entry to TextStream
* A Catalog-Record-Dir has only 2 entries: "0001" and "CADT"
***************************************************************************** */
void ISO8211::writeRecDir4CatS57(QTextStream & iso8211strm, unsigned int recLen0001, unsigned int recLenCATD, unsigned int sizeofFLenF, unsigned int sizeofFPosF)
{
    //** "0001" entry **
    iso8211strm.setPadChar(QChar('0'));
    iso8211strm << "0001";
    iso8211strm.setFieldWidth(sizeofFLenF);
    iso8211strm << recLen0001;
    iso8211strm.setFieldWidth(sizeofFPosF);
    iso8211strm << 0; 

    //** CATD entry **
    iso8211strm << "CATD";
    iso8211strm.setFieldWidth(sizeofFLenF);
    iso8211strm << recLenCATD;
    iso8211strm.setFieldWidth(sizeofFPosF);
    iso8211strm << recLen0001;  //the record length of "0001" field is at the same time the start-pos. of CATD field
    
    iso8211strm.setFieldWidth(0);
    iso8211strm.setPadChar(QChar(' '));

    iso8211strm <<  FT;  
}
コード例 #8
0
void FormattedTouchstone::WriteRow(FormattedNetworkData &network, QTextStream &snpFile, FormattedComplexRowVector &row) {
    uint columnsWritten = 1;
    uint const COLUMNSPERLINE = 4;
    FormattedComplexRowVector::iterator column_iter = row.begin();
    for (; column_iter != row.end(); column_iter++) {
        (*WriteDatum)(snpFile, *column_iter);
        // add delimiter
        if (columnsWritten == network.numberOfPorts()) {
            snpFile.setFieldWidth(0);
            snpFile << endl;
            snpFile.setFieldWidth(COLUMNWIDTH);
        }
        else if (columnsWritten % COLUMNSPERLINE == 0) {
            snpFile.setFieldWidth(0);
            snpFile << endl;
            snpFile.setFieldAlignment(QTextStream::AlignLeft);
            snpFile.setFieldWidth(COLUMNWIDTH);
            snpFile << " ";
        }
        columnsWritten++;
    }
}
コード例 #9
0
ファイル: qwscommand_qws.cpp プロジェクト: wpbest/copperspice
void QWSHexDump::sideviewDump(int at)
{
    if (dirty) {
        dirty = false;
        ++at;
        sideview[at] = '\0';
        int currentWidth = (2 * at) + (at / clustering) - (at%clustering?0:1);
        int missing = qMax(dataWidth - currentWidth, 0);
        while (missing--)
            *outstrm << ' ';

        *outstrm << " [";
        outstrm->setPadChar(' ');
        outstrm->setFieldWidth(wrap);
        outstrm->setFieldAlignment( QTextStream::AlignLeft );
        *outstrm << sideview;
        *outstrm << ']';
    }
}
コード例 #10
0
void FormattedTouchstone::WriteDB(QTextStream &snpFile, FormattedComplex &datum) {
    snpFile.setFieldAlignment(QTextStream::AlignLeft);
    snpFile.setFieldWidth(COLUMNWIDTH);
    snpFile << datum.dB();
    snpFile << datum.angle_deg();
}
コード例 #11
0
void FormattedTouchstone::WriteRI(QTextStream &snpFile, FormattedComplex &datum) {
    snpFile.setFieldAlignment(QTextStream::AlignLeft);
    snpFile.setFieldWidth(COLUMNWIDTH);
    snpFile << datum.real();
    snpFile << datum.imaginary();
}