2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 21:00:32 +01:00
|
|
|
/*
|
|
|
|
* 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/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2009-09-07 17:10:16 +02:00
|
|
|
|
2009-09-08 14:59:07 +02:00
|
|
|
#ifndef INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
|
|
|
|
#define INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
|
2009-09-07 17:10:16 +02:00
|
|
|
|
2014-05-28 15:24:46 +02:00
|
|
|
#include <sal/config.h>
|
2017-04-07 15:59:12 +02:00
|
|
|
|
2019-01-09 12:12:13 +01:00
|
|
|
#include <string_view>
|
|
|
|
|
2015-08-31 20:33:37 -04:00
|
|
|
#include <rtl/strbuf.hxx>
|
2009-09-07 17:10:16 +02:00
|
|
|
|
|
|
|
namespace configmgr {
|
|
|
|
|
2009-10-01 16:48:00 +02:00
|
|
|
class Components;
|
2009-09-07 17:10:16 +02:00
|
|
|
struct Data;
|
|
|
|
|
2015-07-15 14:07:54 +01:00
|
|
|
struct TempFile {
|
|
|
|
OUString url;
|
|
|
|
oslFileHandle handle;
|
|
|
|
bool closed;
|
|
|
|
OStringBuffer buffer;
|
|
|
|
|
2015-11-10 10:11:57 +01:00
|
|
|
TempFile(): handle(nullptr), closed(false) {}
|
2015-07-15 14:07:54 +01:00
|
|
|
~TempFile();
|
|
|
|
void closeAndRename(const OUString &url);
|
|
|
|
oslFileError flush();
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2015-07-15 14:07:54 +01:00
|
|
|
oslFileError closeWithoutUnlink();
|
2015-07-23 09:49:57 +02:00
|
|
|
#endif
|
2019-01-09 12:12:13 +01:00
|
|
|
void writeString(std::string_view text);
|
2015-07-15 14:07:54 +01:00
|
|
|
|
|
|
|
private:
|
2015-10-12 15:25:41 +02:00
|
|
|
TempFile(const TempFile&) = delete;
|
|
|
|
TempFile& operator=(const TempFile&) = delete;
|
2015-07-15 14:07:54 +01:00
|
|
|
};
|
|
|
|
|
2019-01-09 12:12:13 +01:00
|
|
|
void writeAttributeValue(TempFile &handle, std::u16string_view value);
|
|
|
|
void writeValueContent(TempFile &handle, std::u16string_view value);
|
2013-09-10 13:02:15 +02:00
|
|
|
|
2009-10-01 16:48:00 +02:00
|
|
|
void writeModFile(
|
2012-12-10 23:06:10 +02:00
|
|
|
Components & components, OUString const & url, Data const & data);
|
2009-09-07 17:10:16 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|