1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 */ 7 8 #ifndef ORCUS_OOXML_GLOBAL_HPP 9 #define ORCUS_OOXML_GLOBAL_HPP 10 11 #include "orcus/types.hpp" 12 #include "ooxml_types.hpp" 13 14 #include <string> 15 #include <functional> 16 17 namespace orcus { 18 19 struct opc_rel_t; 20 struct xml_token_attr_t; 21 class xml_context_base; 22 23 /** 24 * Function object to print relationship information. 25 */ 26 struct print_opc_rel : ::std::unary_function<opc_rel_t, void> 27 { 28 void operator() (const opc_rel_t& v) const; 29 }; 30 31 /** 32 * Given a directory path and a file name, return a full path that combines 33 * the two while resolving any parent directory path ".." markers. 34 * 35 * @param dir_path directory path. It can optionally start with a '/', but 36 * it must end with a '/'. 37 * @param file_name file name. 38 * 39 * @return full file path. 40 */ 41 std::string resolve_file_path(const std::string& dir_path, const std::string& file_name); 42 43 void init_ooxml_context(xml_context_base& cxt); 44 45 } 46 47 #endif 48 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 49