Exemplo n.º 1
0
bool CharLine::isEqual(const char string[]) const
{
    if (size != getStrSize(string))
        return false;
    for (int i = 0; i < size; i++)
        if (atPosition(i) != string[i])
            return false;
    return true;
}
Exemplo n.º 2
0
CharLine::CharLine(const char *source)
{
    size = getStrSize(source);
    stringLen = (size / 50 + 1) * 50 + 1;
    string = new char[stringLen];
    for (int i = 0; i < size; i++)
        string[i] = source[i];
    string[size] = '\0';
}
Exemplo n.º 3
0
const Token *Token::getValueTokenMinStrSize() const
{
    const Token *ret = nullptr;
    std::size_t minsize = ~0U;
    std::list<ValueFlow::Value>::const_iterator it;
    for (it = values.begin(); it != values.end(); ++it) {
        if (it->tokvalue && it->tokvalue->type() == Token::eString) {
            std::size_t size = getStrSize(it->tokvalue);
            if (!ret || size < minsize) {
                minsize = size;
                ret = it->tokvalue;
            }
        }
    }
    return ret;
}
Exemplo n.º 4
0
    void process()
    {
        if (isEmpty()) return;

        static int time_ = 0;

        auto log = queue_.front();
        if (time_ % logSpd_ == 0)
        {
            if (viewStrSize_ < log->getStrSize())
                ++viewStrSize_;
        }

        log->print(viewStrSize_);

        if (mso::KeyBoard::GetPressMoment(KEY_INPUT_RETURN))
        {
            queue_.pop();
            viewStrSize_ = 0;
            time_ = 0;
        }
        ++time_;
    }