예제 #1
0
void HSSSelectorChain::add(HSSParserNode::p newNode)
{
    if (newNode)
    {
        std_log3("HSSSelectorChain: Added node of type " + newNode->toString());
        newNode->setParentNode(this->shared_from_this());
        this->nodeList.push_back(newNode);
    }
}
예제 #2
0
void HSSSelectorChain::prepend(HSSParserNode::p newNode)
{
    if (newNode)
    {
        std_log3("HSSSelectorChain: Added node of type " + newNode->toString() + " to the front of the selector");
        newNode->setParentNode(this->shared_from_this());
        this->nodeList.push_front(newNode);
    }
}
void HSSPropertyDefinition::addValue(HSSParserNode::p value)
{
    if (this->value){
        if(this->value->isA(HSSParserNodeTypeMultipleValueDefinition)) {
            HSSMultipleValueDefinition::p mvDef = boost::static_pointer_cast<HSSMultipleValueDefinition>(this->value);
            value->setParentNode(this->shared_from_this());
            mvDef->add(value);
        } else {
            HSSMultipleValueDefinition::p mvDef = HSSMultipleValueDefinition::p(new HSSMultipleValueDefinition());
            mvDef->setParentNode(this->shared_from_this());
            mvDef->add(this->value);
            value->setParentNode(this->shared_from_this());
            mvDef->add(value);
            this->value = mvDef;
        }
    } else {
        this->value = value;
    }
}