/* -*- 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/. * * 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 . */ #ifndef INCLUDED_COMPHELPER_SCOPEGUARD_HXX #define INCLUDED_COMPHELPER_SCOPEGUARD_HXX #include #include namespace comphelper { /** ScopeGuard to ease writing exception-safe code. */ class COMPHELPER_DLLPUBLIC ScopeGuard { public: /** @param func function object to be executed in dtor @param excHandling switches whether thrown exceptions in dtor will be silently ignored (but OSL_ asserted) */ template explicit ScopeGuard( func_type const & func ) : m_func( func ) {} ~ScopeGuard(); /** Dismisses the scope guard, i.e. the function won't be executed. */ void dismiss(); private: // noncopyable until we have good reasons... ScopeGuard(const ScopeGuard&) = delete; ScopeGuard& operator=(const ScopeGuard&) = delete; ::std::function m_func; }; } // namespace comphelper #endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX) /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ce-6-3 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2021-04-21loplugin:stringadd replace OUStringLiteral temporaries with OUString::ConcatNoel Grandin
2021-04-15loplugin:stringliteralvar look for assignmentsNoel Grandin
2021-04-12update PCHsCaolán McNamara
2021-04-08update PCHsLuboš Luňák
2021-04-08move set/get Pointer to VCLUnoHelperCaolán McNamara
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
2021-03-21update pchesCaolán McNamara
2021-03-14check for quit when calling Yield in loopNoel Grandin
2021-03-09Make sal/config.h the first in pchMike Kaganski
2021-02-23update pchesCaolán McNamara
2021-02-19loplugin:refcounting in vbahelperNoel
2021-02-08update pchesCaolán McNamara
2021-02-06Use more conversion functions from <tools/UnitConversion.hxx>Mike Kaganski
2021-02-02loplugin:redundantcast catch more dynamic_castNoel
2021-01-28simplify code, use more subView()Noel
2021-01-16make the Color constructors explicitly specify transparencyNoel
2021-01-09fix coverity parse errorsCaolán McNamara
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
2020-12-26New loplugin:stringliteralvarStephan Bergmann
2020-12-04update pchesCaolán McNamara
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel
2020-11-19loplugin:stringview: Flag empty string converted to string viewStephan Bergmann
2020-11-18tdf#123936 Formatting files in module vbahelper with clang-formatPhilipp Hofer
2020-11-17loplugin:stringviewparam check methods tooNoel
2020-11-11disable O(U)String::concat for internal codeNoel Grandin
2020-11-05loplugin:reducevarscope in vbahelperNoel
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
2020-09-22OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaroundCaolán McNamara
2020-09-16Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uStringStephan Bergmann
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
2020-08-21Fix typo in codeAndrea Gelmini
2020-08-18loplugin:unusedvarsglobalNoel Grandin
2020-08-14loplugin:simplifybool moreNoel Grandin
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara
2020-08-03loplugin:flatten in vbahelperNoel Grandin
2020-07-30loplugin:unusedmethodsNoel Grandin
2020-07-12update pchesCaolán McNamara
2020-07-11vbahelper: create instances with uno constructorsNoel Grandin
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: vbahelperStephan Bergmann
2020-06-24use more std::container::insert instead of std::copyNoel Grandin