Don't search for old (<= 2.0) .NET SDK anymore
[LibreOffice.git] / include / comphelper / propertyvalue.hxx
blob3415d2304f836af18f3619c40479d9f0df6d34db
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_COMPHELPER_PROPERTYVALUE_HXX
11 #define INCLUDED_COMPHELPER_PROPERTYVALUE_HXX
13 #include <sal/config.h>
15 #include <utility>
17 #include <com/sun/star/beans/PropertyValue.hpp>
19 namespace comphelper
22 /**
23 * Creates a beans::PropertyValue easily, i.e. you can write:
25 * function(comphelper::makePropertyValue("Foo", nBar));
27 * instead of writing 3 extra lines to set the name and value of the beans::PropertyValue.
29 template<typename T> css::beans::PropertyValue makePropertyValue(const OUString& rName, T&& rValue)
31 css::beans::PropertyValue aValue;
32 aValue.Name = rName;
33 aValue.Value = css::uno::toAny(std::forward<T>(rValue));
34 return aValue;
39 #endif // INCLUDED_COMPHELPER_PROPERTYVALUE_HXX
41 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */