Ejemplo n.º 1
0
/**
 * Checks that all parents, of the element passed in, are valid for storage
 *
 * Note: The elem argument must be in a valid state when using this function
 */
Status storageValidParents(const mb::ConstElement& elem) {
    const mb::ConstElement& root = elem.getDocument().root();
    if (elem != root) {
        const mb::ConstElement& parent = elem.parent();
        if (parent.ok() && parent != root) {
            Status s = storageValid(parent, false);
            if (s.isOK()) {
                s = storageValidParents(parent);
            }

            return s;
        }
    }
    return Status::OK();
}