2013-03-27 20:08:50 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-05-02 15:06:23 +02:00
|
|
|
// Helper string methods
|
2013-03-27 20:08:50 +01:00
|
|
|
|
2013-11-05 02:21:42 +01:00
|
|
|
#ifndef INCLUDED_L10NTOOLS_INC_HELPER_HXX
|
|
|
|
#define INCLUDED_L10NTOOLS_INC_HELPER_HXX
|
2013-03-27 20:08:50 +01:00
|
|
|
|
|
|
|
#include "sal/config.h"
|
|
|
|
#include "sal/types.h"
|
|
|
|
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
|
|
|
|
#include <rtl/string.hxx>
|
|
|
|
#include <rtl/strbuf.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
namespace helper {
|
|
|
|
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Escape all given character in the text
|
2013-04-13 05:43:53 +02:00
|
|
|
OString escapeAll(
|
|
|
|
const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Unescape all given character in the text
|
2013-04-13 05:43:53 +02:00
|
|
|
OString unEscapeAll(
|
|
|
|
const OString& rText, const OString& rEscaped, const OString& rUnEscaped );
|
|
|
|
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Convert special characters to XML entity references
|
2013-03-31 20:11:57 +02:00
|
|
|
OString QuotHTML( const OString &rString );
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Convert XML entity references to single characters
|
2013-03-31 20:11:57 +02:00
|
|
|
OString UnQuotHTML( const OString& rString );
|
2013-03-27 20:08:50 +01:00
|
|
|
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Check whether text is a valid XML expression
|
2013-03-27 20:08:50 +01:00
|
|
|
bool isWellFormedXML( OString const & text );
|
|
|
|
|
2013-05-02 15:06:23 +02:00
|
|
|
/// Convert xmlChar* to OString
|
2013-03-27 20:08:50 +01:00
|
|
|
OString xmlStrToOString( const xmlChar* pString );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|