Example #1
0
void FileIn::setEncoding(WrapperStr s)
{
    if (s.left(3).lower() == "utf") {
        if (s.right(1) != "8") {
            UmlCom::trace("sorry, in the UTF encoding, only UTF-8 is managed");
            throw 0;
        }
        else
            _utf8 = TRUE;
    }
}
Example #2
0
void UmlItem::importExtension(FileIn & in, Token & token, UmlItem * where)
{
    if (! token.closed()) {
        WrapperStr s = token.valueOf("extender");

        if (s.isNull())
            s = token.valueOf("xmi:extender");

        if (s == "Bouml") {
            WrapperStr k = token.what();
            const char * kstr = k;

            while (in.read(), !token.close(kstr)) {
                s = token.what();

                if (s == "taggedvalue")
                    // is closed
                    where->set_PropertyValue(token.valueOf("tag"), token.valueOf("value"));
                else if (s == "stereotype")
                    where->set_Stereotype(token.valueOf("name"));

                if (! token.closed())
                    in.finish(token.what());
            }
        }
        else if (s == "Visual Paradigm for UML") {
            WrapperStr k = token.what();
            const char * kstr = k;

            while (in.read(), !token.close(kstr)) {
                s = token.what();

                if (s == "appliedstereotype") {
                    s = token.valueOf("xmi:value");

                    if (s.right(3) == "_id") {
                        s = s.mid(s.find("_") + 1);
                        s = s.left(s.length() - 3).lower();
                    }

                    where->set_Stereotype(s);
                }

                if (! token.closed())
                    in.finish(token.what());
            }
        }
        else
            in.finish(token.what());
    }
}