FAUST compiler  0.9.9.6b8
Functions
Text.hh File Reference
#include <string>
#include <vector>
Include dependency graph for Text.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string subst (const string &m, const string &a0)
string subst (const string &m, const vector< string > &vargs)
 Text substitution.
string subst (const string &m, const string &a0, const string &a1)
string subst (const string &m, const string &a0, const string &a1, const string &a2)
string subst (const string &model, const string &a0, const string &a1, const string &a2, const string &a3)
string subst (const string &model, const string &a0, const string &a1, const string &a2, const string &a3, const string &a4)
string subst (const string &model, const string &a0, const string &a1, const string &a2, const string &a3, const string &a4, const string &a5)
string subst (const string &model, const string &a0, const string &a1, const string &a2, const string &a3, const string &a4, const string &a5, const string &a6)
string T (char *c)
string T (int n)
string T (long n)
string T (double n)
 Convert a double-precision float into a string.
string unquote (const string &s)
 remove quotes from a string
string quote (const string &s)
 add quotes to a string
string rmWhiteSpaces (const string &s)

Function Documentation

string quote ( const string &  s)

add quotes to a string

Definition at line 214 of file Text.cpp.

{
    string q("\"");
    q += s;
    q += "\"";
    return q;
}
string rmWhiteSpaces ( const string &  s)

Definition at line 222 of file Text.cpp.

Referenced by extractMetadata().

{
    size_t i = s.find_first_not_of(" \t");
    size_t j = s.find_last_not_of(" \t");

    if ( (i != string::npos) & (j != string::npos) ) {
        return s.substr(i, 1+j-i);
    } else {
        return "";
    }
}

Here is the caller graph for this function:

string subst ( const string &  m,
const string &  a0 
)

Definition at line 52 of file Text.cpp.

References substitution().

{
    vector<string> args(10);
    args[0] = a0;
    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  model,
const vector< string > &  args 
)

Text substitution.

Creates a string by replacing all the $n occurences in the model string, with the corresponding arguments. Example : subst("float $0 = $1;", "var", T(10.2))

Definition at line 47 of file Text.cpp.

References substitution().

Referenced by Description::addGroup(), Description::addWidget(), apply_pattern_matcher(), Klass::buildTasksList(), calcNumberedName(), DocCompiler::compileLateq(), SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), ScalarCompiler::compileMultiSignal(), ScalarCompiler::compileSingleSignal(), copyFaustSources(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), ScalarCompiler::generateBinOp(), DocCompiler::generateBinOp(), ScalarCompiler::generateButton(), VectorCompiler::generateCacheCode(), ScalarCompiler::generateCheckbox(), AcosPrim::generateCode(), AsinPrim::generateCode(), AtanPrim::generateCode(), CosPrim::generateCode(), SinPrim::generateCode(), TanPrim::generateCode(), ExpPrim::generateCode(), FloorPrim::generateCode(), FmodPrim::generateCode(), CeilPrim::generateCode(), Atan2Prim::generateCode(), PowPrim::generateCode(), RemainderPrim::generateCode(), LogPrim::generateCode(), Log10Prim::generateCode(), SqrtPrim::generateCode(), AbsPrim::generateCode(), RintPrim::generateCode(), MaxPrim::generateCode(), MinPrim::generateCode(), ScalarCompiler::generateDelayLine(), DocCompiler::generateDelayLine(), VectorCompiler::generateDelayVec(), ScalarCompiler::generateDelayVecNoTemp(), DocCompiler::generateDelayVecNoTemp(), DocCompiler::generateDocAccessTbl(), DocCompiler::generateDocConstantTbl(), DocCompiler::generateDocWriteTbl(), VectorCompiler::generateFixDelay(), ScalarCompiler::generateFixDelay(), DocCompiler::generateFixDelay(), ScalarCompiler::generateFloatCast(), DocCompiler::generateFloatCast(), ScalarCompiler::generateHBargraph(), ScalarCompiler::generateHSlider(), ScalarCompiler::generateInput(), DocCompiler::generateInput(), ScalarCompiler::generateIntCast(), DocCompiler::generateIntCast(), ScalarCompiler::generateIota(), DocCompiler::generateIota(), SinPrim::generateLateq(), AtanPrim::generateLateq(), AcosPrim::generateLateq(), AsinPrim::generateLateq(), TanPrim::generateLateq(), CosPrim::generateLateq(), Atan2Prim::generateLateq(), ExpPrim::generateLateq(), FmodPrim::generateLateq(), CeilPrim::generateLateq(), FloorPrim::generateLateq(), RemainderPrim::generateLateq(), LogPrim::generateLateq(), Log10Prim::generateLateq(), PowPrim::generateLateq(), SqrtPrim::generateLateq(), AbsPrim::generateLateq(), RintPrim::generateLateq(), MinPrim::generateLateq(), MaxPrim::generateLateq(), ScalarCompiler::generateNumEntry(), ScalarCompiler::generateOutput(), DocCompiler::generateOutput(), ScalarCompiler::generatePrefix(), DocCompiler::generatePrefix(), ScalarCompiler::generateRDTbl(), DocCompiler::generateRecProj(), ScalarCompiler::generateSelect2(), DocCompiler::generateSelect2(), ScalarCompiler::generateSelect3(), DocCompiler::generateSelect3(), ScalarCompiler::generateSigGen(), ScalarCompiler::generateStaticSigGen(), ScalarCompiler::generateStaticTable(), ScalarCompiler::generateTable(), Compiler::generateUserInterfaceTree(), VectorCompiler::generateVariableStore(), ScalarCompiler::generateVariableStore(), DocCompiler::generateVariableStore(), ScalarCompiler::generateVBargraph(), ScalarCompiler::generateVSlider(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), ScalarCompiler::generateWRTbl(), ScalarCompiler::getFreshID(), DocCompiler::getFreshID(), ScalarCompiler::getTypedNames(), DocCompiler::getTypedNames(), main(), ScalarCompiler::prepare(), Klass::printComputeMethodOpenMP(), Klass::printComputeMethodScalar(), Klass::printComputeMethodScheduler(), Klass::printComputeMethodVectorFaster(), Klass::printComputeMethodVectorSimple(), printDoc(), printDocDgm(), SigFloatGenKlass::println(), Klass::printOneLoopScheduler(), setSigListNickName(), subst(), substitute(), SchedulerCompiler::vectorLoop(), and VectorCompiler::vectorLoop().

{
    return substitution(model, args);
}

Here is the call graph for this function:

string subst ( const string &  m,
const string &  a0,
const string &  a1 
)

Definition at line 59 of file Text.cpp.

References substitution().

{
    vector<string> args(10);
    args[0] = a0;
    args[1] = a1;

    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  m,
const string &  a0,
const string &  a1,
const string &  a2 
)

Definition at line 68 of file Text.cpp.

References substitution().

{
    vector<string> args(10);

    args[0] = a0;
    args[1] = a1;
    args[2] = a2;

    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  model,
const string &  a0,
const string &  a1,
const string &  a2,
const string &  a3 
)

Definition at line 79 of file Text.cpp.

References substitution().

{
    vector<string> args(10);

    args[0] = a0;
    args[1] = a1;
    args[2] = a2;
    args[3] = a3;

    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  model,
const string &  a0,
const string &  a1,
const string &  a2,
const string &  a3,
const string &  a4 
)

Definition at line 91 of file Text.cpp.

References substitution().

{
    vector<string> args(10);

    args[0] = a0;
    args[1] = a1;
    args[2] = a2;
    args[3] = a3;
    args[4] = a4;

    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  model,
const string &  a0,
const string &  a1,
const string &  a2,
const string &  a3,
const string &  a4,
const string &  a5 
)

Definition at line 104 of file Text.cpp.

References substitution().

{
    vector<string> args(10);

    args[0] = a0;
    args[1] = a1;
    args[2] = a2;
    args[3] = a3;
    args[4] = a4;
    args[5] = a5;

    return substitution (model, args);
}

Here is the call graph for this function:

string subst ( const string &  model,
const string &  a0,
const string &  a1,
const string &  a2,
const string &  a3,
const string &  a4,
const string &  a5,
const string &  a6 
)

Definition at line 118 of file Text.cpp.

References substitution().

{
    vector<string> args(10);

    args[0] = a0;
    args[1] = a1;
    args[2] = a2;
    args[3] = a3;
    args[4] = a4;
    args[5] = a5;
    args[6] = a6;

    return substitution (model, args);
}

Here is the call graph for this function:

string T ( char *  c)
string T ( int  n)

Definition at line 159 of file Text.cpp.

{ char c[64]; snprintf(c, 63, "%d",n);  return string(c); }
string T ( long  n)

Definition at line 160 of file Text.cpp.

{ char c[64]; snprintf(c, 63, "%ld",n); return string(c); }
string T ( double  n)

Convert a double-precision float into a string.

Adjusts the precision p to the needs. Add a trailing f if single-precision is required.

Definition at line 188 of file Text.cpp.

References ensureFloat(), and inumix().

{
    char    c[64];
    int     p = 1;

    do { snprintf(c, 32, "%.*g", p++, n); } while (atof(c) != n);
    ensureFloat(c);
    return string(c)+inumix();
}

Here is the call graph for this function:

string unquote ( const string &  s)

remove quotes from a string

Definition at line 202 of file Text.cpp.

Referenced by yyparse().

{
    assert(s.size() >= 2);
    assert(s[0] == '"');
    assert(s[s.size()-1] == '"');
    return s.substr(1, s.size()-2);
}

Here is the caller graph for this function: