Esempio n. 1
0
Bool TY_(nodeIsHeader)( Node* node )
{
    TidyTagId tid = TagId( node  );
    return ( tid &&
             tid == TidyTag_H1 ||
             tid == TidyTag_H2 ||
             tid == TidyTag_H3 ||
             tid == TidyTag_H4 ||
             tid == TidyTag_H5 ||
             tid == TidyTag_H6 );
}
Esempio n. 2
0
uint nodeHeaderLevel( Node* node )
{
    TidyTagId tid = TagId( node  );
    switch ( tid )
    {
    case TidyTag_H1:
        return 1;
    case TidyTag_H2:
        return 2;
    case TidyTag_H3:
        return 3;
    case TidyTag_H4:
        return 4;
    case TidyTag_H5:
        return 5;
    case TidyTag_H6:
        return 6;
    }
    return 0;
}
//! Returns true if new tags were found, otherwise false.
bool CiSimplePose::updateTags( std::vector<std::shared_ptr<Tag>> const& detectedTags )
{
    bool previouslyUnknownTagsFound = false;

    for ( auto & detectedTag : detectedTags )
    {
        auto detectedTagId = TagId( std::type_index( typeid( detectedTag ) ), detectedTag->getId() );
        auto knownTag = mKnownTags.find( detectedTagId );

        if ( knownTag != mKnownTags.end() )
        {
            // We know this tag / have seen it before
            knownTag->second->update( detectedTag );
        }
        else {
            mKnownTags[detectedTagId] =  detectedTag;
            previouslyUnknownTagsFound = true;
        }
    }

    return previouslyUnknownTagsFound;
}
Esempio n. 4
0
uint TY_(nodeHeaderLevel)( Node* node )
{
    TidyTagId tid = TagId( node  );
    switch ( tid )
    {
    case TidyTag_H1:
        return 1;
    case TidyTag_H2:
        return 2;
    case TidyTag_H3:
        return 3;
    case TidyTag_H4:
        return 4;
    case TidyTag_H5:
        return 5;
    case TidyTag_H6:
        return 6;
    default:
    {
        /* fall through */
    }
    }
    return 0;
}