[09/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/date.h
--
diff --git a/thirdparty/date/include/date/date.h 
b/thirdparty/date/include/date/date.h
new file mode 100644
index 000..cb115a9
--- /dev/null
+++ b/thirdparty/date/include/date/date.h
@@ -0,0 +1,8022 @@
+#ifndef DATE_H
+#define DATE_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2015, 2016, 2017 Howard Hinnant
+// Copyright (c) 2016 Adrian Colomitchi
+// Copyright (c) 2017 Florian Dang
+// Copyright (c) 2017 Paul Thompson
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+#ifndef HAS_STRING_VIEW
+#  if __cplusplus >= 201703
+#define HAS_STRING_VIEW 1
+#  else
+#define HAS_STRING_VIEW 0
+#  endif
+#endif  // HAS_STRING_VIEW
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#if !(__cplusplus >= 201402)
+#  include 
+#endif
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#if HAS_STRING_VIEW
+# include 
+#endif
+#include 
+#include 
+
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wpedantic"
+# if __GNUC__ < 5
+   // GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
+#  pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+# endif
+#endif
+
+namespace date
+{
+
+//---+
+// Configuration |
+//---+
+
+#ifndef ONLY_C_LOCALE
+#  define ONLY_C_LOCALE 0
+#endif
+
+#if defined(_MSC_VER) && (!defined(__clang__) || (_MSC_VER < 1910))
+// MSVC
+#  if _MSC_VER < 1910
+//   before VS2017
+#define CONSTDATA const
+#define CONSTCD11
+#define CONSTCD14
+#define NOEXCEPT _NOEXCEPT
+#  else
+//   VS2017 and later
+#define CONSTDATA constexpr const
+#define CONSTCD11 constexpr
+#define CONSTCD14 constexpr
+#define NOEXCEPT noexcept
+#  endif
+
+#elif defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x5150
+// Oracle Developer Studio 12.6 and earlier
+#  define CONSTDATA constexpr const
+#  define CONSTCD11 constexpr
+#  define CONSTCD14
+#  define NOEXCEPT noexcept
+
+#elif __cplusplus >= 201402
+// C++14
+#  define CONSTDATA constexpr const
+#  define CONSTCD11 constexpr
+#  define CONSTCD14 constexpr
+#  define NOEXCEPT noexcept
+#else
+// C++11
+#  define CONSTDATA constexpr const
+#  define CONSTCD11 constexpr
+#  define CONSTCD14
+#  define NOEXCEPT noexcept
+#endif
+
+#ifndef HAS_VOID_T
+#  if __cplusplus >= 201703
+#define HAS_VOID_T 1
+#  else
+#define HAS_VOID_T 0
+#  endif
+#endif  // HAS_VOID_T
+
+// Protect from Oracle sun macro
+#ifdef sun
+#  undef sun
+#endif
+
+//---+
+// Interface |
+//---+
+
+// durations
+
+using days = std::chrono::duration
+, std::chrono::hours::period>>;
+
+using weeks = std::chrono::duration
+, days::period>>;
+
+using years = std::chrono::duration
+, days::period>>;
+
+using months = std::chrono::duration
+>>;
+
+// time_point
+
+template 
+using sys_time = std::chrono::time_point;
+
+using sys_days= sys_time;
+using sys_seconds = sys_time;
+
+struct local_t {};
+
+template 
+using local_time = std::chrono::time_point;
+
+using local_seconds = local_time;
+using local_days= local_time;
+
+// types
+
+struct last_spec
+{
+explicit last_spec() = default;
+};
+
+class day;
+class month;
+class year;
+
+class weekday;
+class weekday_indexed;
+class 

[04/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/tz.h
--
diff --git a/thirdparty/date/include/date/tz.h 
b/thirdparty/date/include/date/tz.h
new file mode 100644
index 000..9840e7b
--- /dev/null
+++ b/thirdparty/date/include/date/tz.h
@@ -0,0 +1,2575 @@
+#ifndef TZ_H
+#define TZ_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2015, 2016, 2017 Howard Hinnant
+// Copyright (c) 2017 Jiangang Zhuang
+// Copyright (c) 2017 Aaron Bishop
+// Copyright (c) 2017 Tomasz Kamiński
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+// Get more recent database at http://www.iana.org/time-zones
+
+// The notion of "current timezone" is something the operating system is 
expected to "just
+// know". How it knows this is system specific. It's often a value set by the 
user at OS
+// installation time and recorded by the OS somewhere. On Linux and Mac 
systems the current
+// timezone name is obtained by looking at the name or contents of a 
particular file on
+// disk. On Windows the current timezone name comes from the registry. In 
either method,
+// there is no guarantee that the "native" current timezone name obtained will 
match any
+// of the "Standard" names in this library's "database". On Linux, the names 
usually do
+// seem to match so mapping functions to map from native to "Standard" are 
typically not
+// required. On Windows, the names are never "Standard" so mapping is always 
required.
+// Technically any OS may use the mapping process but currently only Windows 
does use it.
+
+#ifndef USE_OS_TZDB
+#  define USE_OS_TZDB 0
+#endif
+
+#ifndef HAS_REMOTE_API
+#  if USE_OS_TZDB == 0
+#ifdef _WIN32
+#  define HAS_REMOTE_API 0
+#else
+#  define HAS_REMOTE_API 1
+#endif
+#  else  // HAS_REMOTE_API makes no since when using the OS timezone database
+#define HAS_REMOTE_API 0
+#  endif
+#endif
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wconstant-logical-operand"
+#endif
+
+static_assert(!(USE_OS_TZDB && HAS_REMOTE_API),
+  "USE_OS_TZDB and HAS_REMOTE_API can not be used together");
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
+
+#ifndef AUTO_DOWNLOAD
+#  define AUTO_DOWNLOAD HAS_REMOTE_API
+#endif
+
+static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true,
+  "AUTO_DOWNLOAD can not be turned on without HAS_REMOTE_API");
+
+#ifndef USE_SHELL_API
+#  define USE_SHELL_API 1
+#endif
+
+#if USE_OS_TZDB
+#  ifdef _WIN32
+#error "USE_OS_TZDB can not be used on Windows"
+#  endif
+#  ifndef MISSING_LEAP_SECONDS
+#ifdef __APPLE__
+#  define MISSING_LEAP_SECONDS 1
+#else
+#  define MISSING_LEAP_SECONDS 0
+#endif
+#  endif
+#else
+#  define MISSING_LEAP_SECONDS 0
+#endif
+
+#ifndef HAS_DEDUCTION_GUIDES
+#  if __cplusplus >= 201703
+#define HAS_DEDUCTION_GUIDES 1
+#  else
+#define HAS_DEDUCTION_GUIDES 0
+#  endif
+#endif  // HAS_DEDUCTION_GUIDES
+
+#include "date.h"
+
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+#include "tz_private.h"
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef _WIN32
+#  ifdef DATE_BUILD_DLL
+#define DATE_API __declspec(dllexport)
+#  elif defined(DATE_USE_DLL)
+#define DATE_API __declspec(dllimport)
+#  else
+#define DATE_API
+#  endif
+#else
+#  ifdef DATE_BUILD_DLL
+#define DATE_API __attribute__ ((visibility ("default")))
+#  else
+#define DATE_API
+#  endif
+#endif
+
+namespace date
+{
+
+enum class choose {earliest, latest};
+
+namespace detail
+{
+

[01/10] [nifi-minifi-cpp] Git Push Summary

2018-05-18 Thread aldrin
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 02f18238e -> 8777ab5f0


[02/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/src/tz.cpp
--
diff --git a/thirdparty/date/src/tz.cpp b/thirdparty/date/src/tz.cpp
new file mode 100644
index 000..f4a819b
--- /dev/null
+++ b/thirdparty/date/src/tz.cpp
@@ -0,0 +1,3788 @@
+// The MIT License (MIT)
+//
+// Copyright (c) 2015, 2016, 2017 Howard Hinnant
+// Copyright (c) 2015 Ville Voutilainen
+// Copyright (c) 2016 Alexander Kormanovsky
+// Copyright (c) 2016, 2017 Jiangang Zhuang
+// Copyright (c) 2017 Nicolas Veloz Savino
+// Copyright (c) 2017 Florian Dang
+// Copyright (c) 2017 Aaron Bishop
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+#ifdef _WIN32
+   // windows.h will be included directly and indirectly (e.g. by curl).
+   // We need to define these macros to prevent windows.h bringing in
+   // more than we need and do it early so windows.h doesn't get included
+   // without these macros having been defined.
+   // min/max macros interfere with the C++ versions.
+#  ifndef NOMINMAX
+#define NOMINMAX
+#  endif
+   // We don't need all that Windows has to offer.
+#  ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#  endif
+
+   // for wcstombs
+#  ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS
+#  endif
+
+   // None of this happens with the MS SDK (at least VS14 which I tested), but:
+   // Compiling with mingw, we get "error: 'KF_FLAG_DEFAULT' was not declared 
in this scope."
+   // and error: 'SHGetKnownFolderPath' was not declared in this scope.".
+   // It seems when using mingw NTDDI_VERSION is undefined and that
+   // causes KNOWN_FOLDER_FLAG and the KF_ flags to not get defined.
+   // So we must define NTDDI_VERSION to get those flags on mingw.
+   // The docs say though here:
+   // 
https://msdn.microsoft.com/en-nz/library/windows/desktop/aa383745(v=vs.85).aspx
+   // that "If you define NTDDI_VERSION, you must also define _WIN32_WINNT."
+   // So we declare we require Vista or greater.
+#  ifdef __MINGW32__
+
+#ifndef NTDDI_VERSION
+#  define NTDDI_VERSION 0x0600
+#  define _WIN32_WINNT _WIN32_WINNT_VISTA
+#elif NTDDI_VERSION < 0x0600
+#  warning "If this fails to compile NTDDI_VERSION may be to low. See 
comments above."
+#endif
+ // But once we define the values above we then get this linker error:
+ // 
"tz.cpp:(.rdata$.refptr.FOLDERID_Downloads[.refptr.FOLDERID_Downloads]+0x0): "
+ // "undefined reference to `FOLDERID_Downloads'"
+ // which #include  cures see:
+ // https://support.microsoft.com/en-us/kb/130869
+#include 
+ // But with  included, the error moves on to:
+ // error: 'FOLDERID_Downloads' was not declared in this scope
+ // Which #include  cures.
+#include 
+
+#  endif  // __MINGW32__
+
+#  include 
+#endif  // _WIN32
+
+#include "date/tz_private.h"
+
+#ifdef __APPLE__
+#  include "date/ios.h"
+#else
+#  define TARGET_OS_IPHONE 0
+#endif
+
+#if USE_OS_TZDB
+#  include 
+#endif
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#if USE_OS_TZDB
+#  include 
+#endif
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// unistd.h is used on some platforms as part of the the means to get
+// the current time zone. On Win32 windows.h provides a means to do it.
+// gcc/mingw supports unistd.h on Win32 but MSVC does not.
+
+#ifdef _WIN32
+#  include  // _unlink etc.
+
+#  if defined(__clang__)
+struct IUnknown;// fix for issue with static_cast<> in objbase.h
+//   (see 
https://github.com/philsquared/Catch/issues/690)
+#  endif
+
+#  include  // CoTaskFree, ShGetKnownFolderPath etc.

[06/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/julian.h
--
diff --git a/thirdparty/date/include/date/julian.h 
b/thirdparty/date/include/date/julian.h
new file mode 100644
index 000..4aac963
--- /dev/null
+++ b/thirdparty/date/include/date/julian.h
@@ -0,0 +1,3046 @@
+#ifndef JULIAN_H
+#define JULIAN_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2016 Howard Hinnant
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+#include "date.h"
+
+namespace julian
+{
+
+// durations
+
+using days = date::days;
+
+using weeks = date::weeks;
+
+using years = std::chrono::duration
+, days::period>>;
+
+using months = std::chrono::duration
+>>;
+
+// time_point
+
+using sys_days   = date::sys_days;
+using local_days = date::local_days;
+
+// types
+
+struct last_spec
+{
+explicit last_spec() = default;
+};
+
+class day;
+class month;
+class year;
+
+class weekday;
+class weekday_indexed;
+class weekday_last;
+
+class month_day;
+class month_day_last;
+class month_weekday;
+class month_weekday_last;
+
+class year_month;
+
+class year_month_day;
+class year_month_day_last;
+class year_month_weekday;
+class year_month_weekday_last;
+
+// date composition operators
+
+CONSTCD11 year_month operator/(const year& y, const month& m) NOEXCEPT;
+CONSTCD11 year_month operator/(const year& y, int  m) NOEXCEPT;
+
+CONSTCD11 month_day operator/(const day& d, const month& m) NOEXCEPT;
+CONSTCD11 month_day operator/(const day& d, int  m) NOEXCEPT;
+CONSTCD11 month_day operator/(const month& m, const day& d) NOEXCEPT;
+CONSTCD11 month_day operator/(const month& m, intd) NOEXCEPT;
+CONSTCD11 month_day operator/(int  m, const day& d) NOEXCEPT;
+
+CONSTCD11 month_day_last operator/(const month& m, last_spec) NOEXCEPT;
+CONSTCD11 month_day_last operator/(int  m, last_spec) NOEXCEPT;
+CONSTCD11 month_day_last operator/(last_spec, const month& m) NOEXCEPT;
+CONSTCD11 month_day_last operator/(last_spec, int  m) NOEXCEPT;
+
+CONSTCD11 month_weekday operator/(const month& m, const weekday_indexed& wdi) 
NOEXCEPT;
+CONSTCD11 month_weekday operator/(int  m, const weekday_indexed& wdi) 
NOEXCEPT;
+CONSTCD11 month_weekday operator/(const weekday_indexed& wdi, const month& m) 
NOEXCEPT;
+CONSTCD11 month_weekday operator/(const weekday_indexed& wdi, int  m) 
NOEXCEPT;
+
+CONSTCD11 month_weekday_last operator/(const month& m, const weekday_last& 
wdl) NOEXCEPT;
+CONSTCD11 month_weekday_last operator/(int  m, const weekday_last& 
wdl) NOEXCEPT;
+CONSTCD11 month_weekday_last operator/(const weekday_last& wdl, const month& 
m) NOEXCEPT;
+CONSTCD11 month_weekday_last operator/(const weekday_last& wdl, int  
m) NOEXCEPT;
+
+CONSTCD11 year_month_day operator/(const year_month& ym, const day& d) 
NOEXCEPT;
+CONSTCD11 year_month_day operator/(const year_month& ym, intd) 
NOEXCEPT;
+CONSTCD11 year_month_day operator/(const year& y, const month_day& md) 
NOEXCEPT;
+CONSTCD11 year_month_day operator/(int y, const month_day& md) 
NOEXCEPT;
+CONSTCD11 year_month_day operator/(const month_day& md, const year& y) 
NOEXCEPT;
+CONSTCD11 year_month_day operator/(const month_day& md, int y) 
NOEXCEPT;
+
+CONSTCD11
+year_month_day_last operator/(const year_month& ym,   last_spec) NOEXCEPT;
+CONSTCD11
+year_month_day_last operator/(const year& y, const month_day_last& mdl) 
NOEXCEPT;
+CONSTCD11
+year_month_day_last operator/(int y, const month_day_last& mdl) 
NOEXCEPT;
+CONSTCD11
+

[10/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
MINIFICPP-472 Added date formatting EL functions

This closes #315.

Signed-off-by: Aldrin Piri 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/8777ab5f
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/8777ab5f
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/8777ab5f

Branch: refs/heads/master
Commit: 8777ab5f02cfc33e533fd9784b8721dcc5e348e7
Parents: 02f1823
Author: Andrew I. Christianson 
Authored: Mon Apr 30 15:41:17 2018 -0400
Committer: Aldrin Piri 
Committed: Fri May 18 20:06:12 2018 -0400

--
 EXPRESSIONS.md  |   91 +-
 LICENSE |   34 +
 extensions/expression-language/CMakeLists.txt   |5 +
 extensions/expression-language/Expression.cpp   |   48 +
 extensions/expression-language/common/Value.h   |4 +
 .../impl/expression/Expression.h|7 +
 .../ExpressionLanguageTests.cpp |   42 +
 thirdparty/date/.gitignore  |  194 +
 thirdparty/date/CMakeLists.txt  |  164 +
 thirdparty/date/LICENSE.txt |   31 +
 thirdparty/date/README.md   |   58 +
 thirdparty/date/compile_fail.sh |   16 +
 thirdparty/date/include/date/chrono_io.h|   34 +
 thirdparty/date/include/date/date.h | 8022 ++
 thirdparty/date/include/date/ios.h  |   50 +
 thirdparty/date/include/date/islamic.h  | 3031 +++
 thirdparty/date/include/date/iso_week.h | 1745 
 thirdparty/date/include/date/julian.h   | 3046 +++
 thirdparty/date/include/date/ptz.h  |  592 ++
 thirdparty/date/include/date/tz.h   | 2575 ++
 thirdparty/date/include/date/tz_private.h   |  318 +
 thirdparty/date/src/ios.mm  |  337 +
 thirdparty/date/src/tz.cpp  | 3788 +
 thirdparty/date/test_fail.sh|   10 +
 24 files changed, 24236 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/EXPRESSIONS.md
--
diff --git a/EXPRESSIONS.md b/EXPRESSIONS.md
index 1056900..79b9e0c 100644
--- a/EXPRESSIONS.md
+++ b/EXPRESSIONS.md
@@ -236,6 +236,12 @@ token, filename.
 - [`join`](#join)
 - [`count`](#count)
 
+### Date Manipulation
+
+- [`format`](#format)
+- [`toDate`](#todate)
+- [`now`](#now)
+
 ## Planned Features
 
 ### Searching
@@ -249,12 +255,6 @@ token, filename.
 - `unescapeHtml3`
 - `unescapeHtml4`
 
-### Date Manipulation
-
-- `format`
-- `toDate`
-- `now`
-
 ### Subjectless Functions
 
 - `nextInt`
@@ -1820,3 +1820,82 @@ consider the following examples:
 | `${allDelineatedValues(${number_list}, ","):count()}` | `5` |
 | `${allAttributes("abc", "non-existent-attr", "xyz"):count()}` | `2` |
 | `${allMatchingAttributes(".*"):length():gt(10):count()}` | `2` |
+
+### format
+
+**Description**: Formats a number as a date/time according to the format
+specified by the argument. The argument must be a String that is a valid
+strftime format. The Subject is expected to be a Number that represents the
+number of milliseconds since Midnight GMT on January 1, 1970. The number will
+be evaluated using the local time zone unless specified in the second optional
+argument.
+
+**Subject Type**: Number
+
+**Arguments**:
+
+| Argument | Description |
+| - | - |
+| format | The format to use in the strftime syntax |
+| time zone | Optional argument that specifies the time zone to use from the 
IANA Time Zone Database (e.g. 'America/New_York') |
+
+**Return Type**: String
+
+**Examples**:
+
+If the attribute "time" has the value "1420058163264", then the following
+Expressions will yield the following results:
+
+| Expression | Value |
+| - | - |
+| `${time:format("%Y/%m/%d %H:%M:%S", "GMT")}` | `2014/12/31 20:36:03` |
+| `${time:format("%Y", "America/Los_Angeles")}` | `2014` |
+
+### toDate
+
+**Description**: Converts a String into a date represented by the number of
+milliseconds since the UNIX epoch, based on the format specified by the
+argument. The argument must be a String that is a valid strftime syntax. The
+Subject is expected to be a String that is formatted according the argument.
+The date will be evaluated using the local time zone unless specified in the
+second optional argument.
+
+**Subject Type**: String
+
+| format | The format to use in the strftime syntax |
+| time zone | Optional argument that specifies the time zone to use when 
parsing the subject, from the IANA Time Zone Database (e.g. 'America/New_York') 
|
+
+**Return Type**: Number
+
+**Examples**:
+
+If the 

[03/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/tz_private.h
--
diff --git a/thirdparty/date/include/date/tz_private.h 
b/thirdparty/date/include/date/tz_private.h
new file mode 100644
index 000..1aaad8e
--- /dev/null
+++ b/thirdparty/date/include/date/tz_private.h
@@ -0,0 +1,318 @@
+#ifndef TZ_PRIVATE_H
+#define TZ_PRIVATE_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2015, 2016 Howard Hinnant
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
+#include "tz.h"
+#else
+#include "date.h"
+#include 
+#endif
+
+namespace date
+{
+
+namespace detail
+{
+
+#if !USE_OS_TZDB
+
+enum class tz {utc, local, standard};
+
+//forward declare to avoid warnings in gcc 6.2
+class MonthDayTime;
+std::istream& operator>>(std::istream& is, MonthDayTime& x);
+std::ostream& operator<<(std::ostream& os, const MonthDayTime& x);
+
+
+class MonthDayTime
+{
+private:
+struct pair
+{
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+pair() : month_day_(date::jan / 1), weekday_(0U) {}
+
+pair(const date::month_day& month_day, const date::weekday& weekday)
+: month_day_(month_day), weekday_(weekday) {}
+#endif
+
+date::month_day month_day_;
+date::weekday   weekday_;
+};
+
+enum Type {month_day, month_last_dow, lteq, gteq};
+
+Type type_{month_day};
+
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
+union U
+#else
+struct U
+#endif
+{
+date::month_day  month_day_;
+date::month_weekday_last month_weekday_last_;
+pair month_day_weekday_;
+
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
+U() : month_day_{date::jan/1} {}
+#else
+U() :
+month_day_(date::jan/1),
+month_weekday_last_(date::month(0U), 
date::weekday_last(date::weekday(0U)))
+{}
+
+#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
+
+U& operator=(const date::month_day& x);
+U& operator=(const date::month_weekday_last& x);
+U& operator=(const pair& x);
+} u;
+
+std::chrono::hours   h_{0};
+std::chrono::minutes m_{0};
+std::chrono::seconds s_{0};
+tz   zone_{tz::local};
+
+public:
+MonthDayTime() = default;
+MonthDayTime(local_seconds tp, tz timezone);
+MonthDayTime(const date::month_day& md, tz timezone);
+
+date::day day() const;
+date::month month() const;
+tz zone() const {return zone_;}
+
+void canonicalize(date::year y);
+
+sys_seconds
+   to_sys(date::year y, std::chrono::seconds offset, std::chrono::seconds 
save) const;
+sys_days to_sys_days(date::year y) const;
+
+sys_seconds to_time_point(date::year y) const;
+int compare(date::year y, const MonthDayTime& x, date::year yx,
+std::chrono::seconds offset, std::chrono::minutes prev_save) 
const;
+
+friend std::istream& operator>>(std::istream& is, MonthDayTime& x);
+friend std::ostream& operator<<(std::ostream& os, const MonthDayTime& x);
+};
+
+// A Rule specifies one or more set of datetimes without using an offset.
+// Multiple dates are specified with multiple years.  The years in effect
+// go from starting_year_ to ending_year_, inclusive.  starting_year_ <=
+// ending_year_. save_ is in effect for times from the specified time
+// onward, including the specified time. When the specified time is
+// local, it uses the save_ from the chronologically previous Rule, or if
+// there is none, 0.
+
+//forward declare to avoid warnings in gcc 6.2
+class Rule;
+bool 

[08/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/ios.h
--
diff --git a/thirdparty/date/include/date/ios.h 
b/thirdparty/date/include/date/ios.h
new file mode 100644
index 000..ee54b9d
--- /dev/null
+++ b/thirdparty/date/include/date/ios.h
@@ -0,0 +1,50 @@
+//
+//  ios.h
+//  DateTimeLib
+//
+// The MIT License (MIT)
+//
+// Copyright (c) 2016 Alexander Kormanovsky
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+
+#ifndef ios_hpp
+#define ios_hpp
+
+#if __APPLE__
+# include 
+# if TARGET_OS_IPHONE
+#   include 
+
+namespace date
+{
+namespace iOSUtils
+{
+
+std::string get_tzdata_path();
+std::string get_current_timezone();
+
+}  // namespace iOSUtils
+}  // namespace date
+
+# endif  // TARGET_OS_IPHONE
+#else   // !__APPLE__
+# define TARGET_OS_IPHONE 0
+#endif  // !__APPLE__
+#endif // ios_hpp

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/islamic.h
--
diff --git a/thirdparty/date/include/date/islamic.h 
b/thirdparty/date/include/date/islamic.h
new file mode 100644
index 000..b18c493
--- /dev/null
+++ b/thirdparty/date/include/date/islamic.h
@@ -0,0 +1,3031 @@
+#ifndef ISLAMIC_H
+#define ISLAMIC_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2016 Howard Hinnant
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+//
+// Our apologies.  When the previous paragraph was written, lowercase had not 
yet
+// been invented (that would involve another several millennia of evolution).
+// We did not mean to shout.
+
+#include "date.h"
+
+namespace islamic
+{
+
+// durations
+
+using days = date::days;
+
+using weeks = date::weeks;
+
+using years = std::chrono::duration
+, days::period>>;
+
+using months = std::chrono::duration
+>>;
+
+// time_point
+
+using sys_days   = date::sys_days;
+using local_days = date::local_days;
+
+// types
+
+struct last_spec
+{
+explicit last_spec() = default;
+};
+
+class day;
+class month;
+class year;
+
+class weekday;
+class weekday_indexed;
+class weekday_last;
+
+class month_day;
+class month_day_last;
+class month_weekday;
+class month_weekday_last;
+
+class year_month;
+
+class year_month_day;
+class year_month_day_last;
+class year_month_weekday;
+class year_month_weekday_last;
+
+// date composition operators
+
+CONSTCD11 year_month operator/(const year& y, const month& m) NOEXCEPT;
+CONSTCD11 year_month operator/(const year& y, int  m) NOEXCEPT;
+
+CONSTCD11 month_day operator/(const day& d, const month& m) NOEXCEPT;
+CONSTCD11 month_day operator/(const day& d, int  m) NOEXCEPT;
+CONSTCD11 month_day 

[07/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/iso_week.h
--
diff --git a/thirdparty/date/include/date/iso_week.h 
b/thirdparty/date/include/date/iso_week.h
new file mode 100644
index 000..5bbeb0c
--- /dev/null
+++ b/thirdparty/date/include/date/iso_week.h
@@ -0,0 +1,1745 @@
+#ifndef ISO_WEEK_H
+#define ISO_WEEK_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2015, 2016, 2017 Howard Hinnant
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+
+#include "date.h"
+
+#include 
+
+namespace iso_week
+{
+
+// y/wn/wd
+// wn/wd/y
+// wd/wn/y
+
+using days = date::days;
+using weeks = date::weeks;
+using years = date::years;
+
+// time_point
+
+using sys_days = date::sys_days;
+using local_days = date::local_days;
+
+// types
+
+struct last_week
+{
+explicit last_week() = default;
+};
+
+class weekday;
+class weeknum;
+class year;
+
+class year_weeknum;
+class year_lastweek;
+class weeknum_weekday;
+class lastweek_weekday;
+
+class year_weeknum_weekday;
+class year_lastweek_weekday;
+
+// date composition operators
+
+CONSTCD11 year_weeknum operator/(const year& y, const weeknum& wn) NOEXCEPT;
+CONSTCD11 year_weeknum operator/(const year& y, intwn) NOEXCEPT;
+
+CONSTCD11 year_lastweek operator/(const year& y, last_week  wn) NOEXCEPT;
+
+CONSTCD11 weeknum_weekday operator/(const weeknum& wn, const weekday& wd) 
NOEXCEPT;
+CONSTCD11 weeknum_weekday operator/(const weeknum& wn, intwd) 
NOEXCEPT;
+CONSTCD11 weeknum_weekday operator/(const weekday& wd, const weeknum& wn) 
NOEXCEPT;
+CONSTCD11 weeknum_weekday operator/(const weekday& wd, intwn) 
NOEXCEPT;
+
+CONSTCD11 lastweek_weekday operator/(const last_week& wn, const weekday& wd) 
NOEXCEPT;
+CONSTCD11 lastweek_weekday operator/(const last_week& wn, intwd) 
NOEXCEPT;
+CONSTCD11 lastweek_weekday operator/(const weekday& wd, const last_week& wn) 
NOEXCEPT;
+
+CONSTCD11 year_weeknum_weekday operator/(const year_weeknum& ywn, const 
weekday& wd) NOEXCEPT;
+CONSTCD11 year_weeknum_weekday operator/(const year_weeknum& ywn, int  
  wd) NOEXCEPT;
+CONSTCD11 year_weeknum_weekday operator/(const weeknum_weekday& wnwd, const 
year& y) NOEXCEPT;
+CONSTCD11 year_weeknum_weekday operator/(const weeknum_weekday& wnwd, int  
   y) NOEXCEPT;
+
+CONSTCD11 year_lastweek_weekday operator/(const year_lastweek& ylw, const 
weekday& wd) NOEXCEPT;
+CONSTCD11 year_lastweek_weekday operator/(const year_lastweek& ylw, int
wd) NOEXCEPT;
+
+CONSTCD11 year_lastweek_weekday operator/(const lastweek_weekday& lwwd, const 
year& y) NOEXCEPT;
+CONSTCD11 year_lastweek_weekday operator/(const lastweek_weekday& lwwd, int
 y) NOEXCEPT;
+
+// weekday
+
+class weekday
+{
+unsigned char wd_;
+public:
+explicit CONSTCD11 weekday(unsigned wd) NOEXCEPT;
+CONSTCD11 weekday(date::weekday wd) NOEXCEPT;
+explicit weekday(int) = delete;
+CONSTCD11 weekday(const sys_days& dp) NOEXCEPT;
+CONSTCD11 explicit weekday(const local_days& dp) NOEXCEPT;
+
+weekday& operator++()NOEXCEPT;
+weekday  operator++(int) NOEXCEPT;
+weekday& operator--()NOEXCEPT;
+weekday  operator--(int) NOEXCEPT;
+
+weekday& operator+=(const days& d) NOEXCEPT;
+weekday& operator-=(const days& d) NOEXCEPT;
+
+CONSTCD11 explicit operator unsigned() const NOEXCEPT;
+CONSTCD11 operator date::weekday() const NOEXCEPT;
+CONSTCD11 bool ok() const NOEXCEPT;
+
+private:
+static CONSTCD11 unsigned char weekday_from_days(int z) NOEXCEPT;
+static CONSTCD11 unsigned char to_iso_encoding(unsigned char) NOEXCEPT;
+static CONSTCD11 unsigned from_iso_encoding(unsigned) NOEXCEPT;
+};
+
+CONSTCD11 bool operator==(const weekday& x, const weekday& y) NOEXCEPT;
+CONSTCD11 bool operator!=(const weekday& x, const weekday& y) NOEXCEPT;
+
+CONSTCD14 weekday 

[05/10] nifi-minifi-cpp git commit: MINIFICPP-472 Added date formatting EL functions

2018-05-18 Thread aldrin
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/8777ab5f/thirdparty/date/include/date/ptz.h
--
diff --git a/thirdparty/date/include/date/ptz.h 
b/thirdparty/date/include/date/ptz.h
new file mode 100644
index 000..78be1d2
--- /dev/null
+++ b/thirdparty/date/include/date/ptz.h
@@ -0,0 +1,592 @@
+#ifndef PTZ_H
+#define PTZ_H
+
+// The MIT License (MIT)
+//
+// Copyright (c) 2017 Howard Hinnant
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in 
all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
+// SOFTWARE.
+
+// This header allows Posix-style time zones as specified for TZ here:
+// 
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
+//
+// Posix::time_zone can be constructed with a posix-style string and then used 
in
+// a zoned_time like so:
+//
+// zoned_time 
zt{"EST5EDT,M3.2.0,M11.1.0",
+// 
system_clock::now()};
+// or:
+//
+// Posix::time_zone tz{"EST5EDT,M3.2.0,M11.1.0"};
+// zoned_time zt{tz, 
system_clock::now()};
+//
+// Note, Posix-style time zones are not recommended for all of the reasons 
described here:
+// https://stackoverflow.com/tags/timezone/info
+//
+// They are provided here as a non-trivial custom time zone example, and if 
you really
+// have to have Posix time zones, you're welcome to use this one.
+
+#include "date/tz.h"
+#include 
+#include 
+#include 
+
+namespace Posix
+{
+
+namespace detail
+{
+
+#if HAS_STRING_VIEW
+
+using string_t = std::string_view;
+
+#else  // !HAS_STRING_VIEW
+
+using string_t = std::string;
+
+#endif  // !HAS_STRING_VIEW
+
+class rule;
+
+void throw_invalid(const string_t& s, unsigned i, const string_t& message);
+unsigned read_date(const string_t& s, unsigned i, rule& r);
+unsigned read_name(const string_t& s, unsigned i, std::string& name);
+unsigned read_signed_time(const string_t& s, unsigned i, std::chrono::seconds& 
t);
+unsigned read_unsigned_time(const string_t& s, unsigned i, 
std::chrono::seconds& t);
+unsigned read_unsigned(const string_t& s, unsigned i,  unsigned limit, 
unsigned& u);
+
+class rule
+{
+enum {off, J, M, N};
+
+date::month m_;
+date::weekday wd_;
+unsigned short n_: 14;
+unsigned short mode_ : 2;
+std::chrono::duration time_ = std::chrono::hours{2};
+
+public:
+rule() : mode_(off) {}
+
+bool ok() const {return mode_ != off;}
+date::local_seconds operator()(date::year y) const;
+
+friend std::ostream& operator<<(std::ostream& os, const rule& r);
+friend unsigned read_date(const string_t& s, unsigned i, rule& r);
+};
+
+inline
+date::local_seconds
+rule::operator()(date::year y) const
+{
+using namespace date;
+using sec = std::chrono::seconds;
+date::local_seconds t;
+switch (mode_)
+{
+case J:
+t = local_days{y/jan/0} + days{n_ + (y.is_leap() && n_ > 59)} + 
sec{time_};
+break;
+case M:
+t = (n_ == 5 ? local_days{y/m_/wd_[last]} : local_days{y/m_/wd_[n_]}) 
+ sec{time_};
+break;
+case N:
+t = local_days{y/jan/1} + days{n_} + sec{time_};
+break;
+default:
+assert(!"rule called with bad mode");
+}
+return t;
+}
+
+inline
+std::ostream&
+operator<<(std::ostream& os, const rule& r)
+{
+switch (r.mode_)
+{
+case rule::J:
+os << 'J' << r.n_ << date::format(" %T", r.time_);
+break;
+case rule::M:
+if (r.n_ == 5)
+os << r.m_/r.wd_[date::last];
+else
+os << r.m_/r.wd_[r.n_];
+os <<  date::format(" %T", r.time_);
+break;
+case rule::N:
+os << r.n_ << date::format(" %T", r.time_);
+break;
+default:
+break;
+}
+return os;
+}
+
+}  // namespace detail
+
+class time_zone
+{
+std::string  std_abbrev_;
+std::string  dst_abbrev_ = {};

nifi-minifi-cpp git commit: MINIFICPP-403: Update connectables so that they contain a reference to the flow identifier. With this approach the flow identifier will be updated with C2 and automatically

2018-05-18 Thread aldrin
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 45acefaac -> 02f18238e


MINIFICPP-403: Update connectables so that they contain a reference to the flow
identifier. With this approach the flow identifier will be updated with C2
and automatically apply to any processors applied as a result of that update

This closes #331.

closes #313
closes #295

Signed-off-by: Aldrin Piri 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/02f18238
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/02f18238
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/02f18238

Branch: refs/heads/master
Commit: 02f18238e8f579e2597cf21154fc693afb6d4fa0
Parents: 45acefa
Author: Marc Parisi 
Authored: Tue May 15 13:45:02 2018 -0400
Committer: Aldrin Piri 
Committed: Fri May 18 16:15:34 2018 -0400

--
 extensions/http-curl/tests/C2UpdateTest.cpp |  2 +-
 .../http-curl/tests/HttpGetIntegrationTest.cpp  |  1 +
 libminifi/CMakeLists.txt|  2 +-
 libminifi/include/FlowController.h  |  3 +-
 libminifi/include/FlowFileRecord.h  |  6 +-
 libminifi/include/core/Connectable.h| 19 +++-
 libminifi/include/core/FlowConfiguration.h  | 14 ++-
 libminifi/include/core/ProcessorNode.h  | 14 ++-
 libminifi/include/core/state/FlowIdentifier.h   | 91 
 .../include/core/state/nodes/FlowInformation.h  | 67 +++---
 libminifi/src/FlowController.cpp| 35 +---
 libminifi/src/FlowFileRecord.cpp| 18 +++-
 libminifi/src/core/Connectable.cpp  |  2 +
 libminifi/src/core/FlowConfiguration.cpp| 29 +++
 libminifi/src/core/ProcessSession.cpp   | 55 
 libminifi/src/core/yaml/YamlConfiguration.cpp   |  2 +
 libminifi/test/TestBase.cpp |  6 +-
 libminifi/test/TestBase.h   | 20 ++---
 libminifi/test/unit/GetFileTests.cpp|  1 +
 19 files changed, 285 insertions(+), 102 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/02f18238/extensions/http-curl/tests/C2UpdateTest.cpp
--
diff --git a/extensions/http-curl/tests/C2UpdateTest.cpp 
b/extensions/http-curl/tests/C2UpdateTest.cpp
index 0799ae5..52e60f8 100644
--- a/extensions/http-curl/tests/C2UpdateTest.cpp
+++ b/extensions/http-curl/tests/C2UpdateTest.cpp
@@ -174,7 +174,7 @@ int main(int argc, char **argv) {
 
   auto milliseconds = 
std::chrono::duration_cast(then - start).count();
   std::string logs = LogTestController::getInstance().log_output.str();
-  assert(logs.find("Starting to reload Flow Controller with flow control name 
MiNiFi Flow, version 0") != std::string::npos);
+  assert(logs.find("Starting to reload Flow Controller with flow control name 
MiNiFi Flow, version") != std::string::npos);
   LogTestController::getInstance().reset();
   rmdir("./content_repository");
   assert(h_ex.calls_ <= (milliseconds / 1000) + 1);

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/02f18238/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
--
diff --git a/extensions/http-curl/tests/HttpGetIntegrationTest.cpp 
b/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
index df40497..9e6e99f 100644
--- a/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
+++ b/extensions/http-curl/tests/HttpGetIntegrationTest.cpp
@@ -154,6 +154,7 @@ int main(int argc, char **argv) {
   assert(logs.find("key:filename value:") != std::string::npos);
   assert(logs.find("key:invokehttp.request.url value:" + url) != 
std::string::npos);
   assert(logs.find("key:invokehttp.status.code value:200") != 
std::string::npos);
+  assert(logs.find("key:flow.id") != std::string::npos);
 
   LogTestController::getInstance().reset();
   rmdir("./content_repository");

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/02f18238/libminifi/CMakeLists.txt
--
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index 3e6390f..302b7f8 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -59,7 +59,7 @@ include_directories(../thirdparty/rapidjson-1.1.0/include)
 include_directories(../thirdparty/concurrentqueue/)
 include_directories(include)
 
-file(GLOB SOURCES  "src/sitetosite/*.cpp"  "src/core/logging/*.cpp"  
"src/core/state/*.cpp" "src/c2/protocols/*.cpp" "src/c2/*.cpp" "src/io/*.cpp" 
"src/io/tls/*.cpp" "src/core/controller/*.cpp" "src/controllers/*.cpp" 
"src/core/*.cpp"  "src/core/repository/*.cpp" "src/core/yaml/*.cpp" 

nifi git commit: NIFI-5217: Allow non-nullable fields to be added to MockRecordParser

2018-05-18 Thread mattyb149
Repository: nifi
Updated Branches:
  refs/heads/master 29e96ed0e -> d79216d6b


NIFI-5217: Allow non-nullable fields to be added to MockRecordParser

Signed-off-by: Matthew Burgess 

This closes #2720


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/d79216d6
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/d79216d6
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/d79216d6

Branch: refs/heads/master
Commit: d79216d6b08a842dc0c5f6b847429aae87fb5561
Parents: 29e96ed
Author: Matthew Burgess 
Authored: Fri May 18 15:17:03 2018 -0400
Committer: Matthew Burgess 
Committed: Fri May 18 15:59:12 2018 -0400

--
 .../java/org/apache/nifi/serialization/record/RecordField.java | 2 +-
 .../org/apache/nifi/serialization/record/MockRecordParser.java | 6 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi/blob/d79216d6/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java
--
diff --git 
a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java
 
b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java
index b4ff848..2c4954c 100644
--- 
a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java
+++ 
b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java
@@ -24,7 +24,7 @@ import java.util.Objects;
 import java.util.Set;
 
 public class RecordField {
-private static final boolean DEFAULT_NULLABLE = true;
+public static final boolean DEFAULT_NULLABLE = true;
 
 private final String fieldName;
 private final DataType dataType;

http://git-wip-us.apache.org/repos/asf/nifi/blob/d79216d6/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-mock-record-utils/src/main/java/org/apache/nifi/serialization/record/MockRecordParser.java
--
diff --git 
a/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-mock-record-utils/src/main/java/org/apache/nifi/serialization/record/MockRecordParser.java
 
b/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-mock-record-utils/src/main/java/org/apache/nifi/serialization/record/MockRecordParser.java
index 0fcdcbf..9b5441e 100644
--- 
a/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-mock-record-utils/src/main/java/org/apache/nifi/serialization/record/MockRecordParser.java
+++ 
b/nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-mock-record-utils/src/main/java/org/apache/nifi/serialization/record/MockRecordParser.java
@@ -51,7 +51,11 @@ public class MockRecordParser extends 
AbstractControllerService implements Recor
 }
 
 public void addSchemaField(final String fieldName, final RecordFieldType 
type) {
-fields.add(new RecordField(fieldName, type.getDataType()));
+addSchemaField(fieldName, type, RecordField.DEFAULT_NULLABLE);
+}
+
+public void addSchemaField(final String fieldName, final RecordFieldType 
type, boolean isNullable) {
+fields.add(new RecordField(fieldName, type.getDataType(), isNullable));
 }
 
 public void addRecord(Object... values) {



nifi-minifi-cpp git commit: MINIFICPP-369 Added multiple attribute/aggregate EL functions

2018-05-18 Thread aldrin
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 1ec799039 -> 45acefaac


MINIFICPP-369 Added multiple attribute/aggregate EL functions

This closes #325.

Signed-off-by: Aldrin Piri 


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/45acefaa
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/45acefaa
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/45acefaa

Branch: refs/heads/master
Commit: 45acefaaca12cd0d1325918f6f3400bf2163a452
Parents: 1ec7990
Author: Andrew I. Christianson 
Authored: Wed May 9 16:09:59 2018 -0400
Committer: Aldrin Piri 
Committed: Fri May 18 14:17:25 2018 -0400

--
 EXPRESSIONS.md  | 253 +-
 extensions/expression-language/Expression.cpp   | 487 ++-
 .../impl/expression/Expression.h|  49 +-
 .../ExpressionLanguageTests.cpp | 199 
 4 files changed, 948 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/45acefaa/EXPRESSIONS.md
--
diff --git a/EXPRESSIONS.md b/EXPRESSIONS.md
index d5a34bb..1056900 100644
--- a/EXPRESSIONS.md
+++ b/EXPRESSIONS.md
@@ -225,6 +225,17 @@ token, filename.
 - [`UUID`](#uuid)
 - [`literal`](#literal)
 
+### Evaluating Multiple Attributes
+
+- [`anyAttribute`](#anyattribute)
+- [`allAttributes`](#allattributes)
+- [`anyMatchingAttribute`](#anymatchingattribute)
+- [`allMatchingAttributes`](#allmatchingattributes)
+- [`anyDelineatedValue`](#anydelineatedvalue)
+- [`allDelineatedValues`](#alldelineatedvalues)
+- [`join`](#join)
+- [`count`](#count)
+
 ## Planned Features
 
 ### Searching
@@ -249,17 +260,6 @@ token, filename.
 - `nextInt`
 - `getStateValue`
 
-### Evaluating Multiple Attributes
-
-- `anyAttribute`
-- `allAttributes`
-- `anyMatchingAttribute`
-- `allMatchingAttributes`
-- `anyDelineatedValue`
-- `allDelineatedValues`
-- `join`
-- `count`
-
 ## Unsupported Features
 
 The following EL features are currently not supported, and no support is
@@ -1589,3 +1589,234 @@ to evaluate additional functions against.
 **Examples**: `${literal(2):gt(1)}` returns true.  `${literal(
 ${allMatchingAttributes('a.*'):count()} ):gt(3)}` returns true if there are
 more than 3 attributes whose names begin with the letter a.
+
+## Evaluating Multiple Attributes
+
+When it becomes necessary to evaluate the same conditions against multiple
+attributes, this can be accomplished by means of the and and or functions.
+However, this quickly becomes tedious, error-prone, and difficult to maintain.
+For this reason, NiFi Expression Language provides several functions for
+evaluating the same conditions against groups of attributes at the same time.
+
+### anyAttribute
+
+**Description**: Checks to see if any of the given attributes, match the given
+condition. This function has no subject and takes one or more arguments that
+are the names of attributes to which the remainder of the Expression is to be
+applied. If any of the attributes specified, when evaluated against the rest of
+the Expression, returns a value of `true`, then this function will return
+`true`.  Otherwise, this function will return `false`.
+
+**Subject Type**: No Subject
+
+**Arguments**: 
+
+| Argument | Description |
+| - | - |
+| Attribute Names | One or more attribute names to evaluate |
+
+**Return Type**: Boolean
+
+**Examples**: Given that the "abc" attribute contains the value "hello world",
+"xyz" contains "good bye world", and "filename" contains "file.txt" consider
+the following examples:
+
+| Expression | Value |
+| - | - |
+| `${anyAttribute("abc", "xyz"):contains("bye")}` | `true` |
+| `${anyAttribute("filename","xyz"):toUpper():contains("e")}` | `false` |
+
+### allAttributes
+
+**Description**: Checks to see if all of the given attributes match the given
+condition. This function has no subject and takes one or more arguments that
+are the names of attributes to which the remainder of the Expression is to be
+applied. If all of the attributes specified, when evaluated against the rest of
+the Expression, returns a value of `true`, then this function will return
+`true`. Otherwise, this function will return `false`.
+
+**Subject Type**: No Subject
+
+**Arguments**: 
+
+| Argument | Description |
+| - | - |
+| Attribute Names | One or more attribute names to evaluate |
+
+**Return Type**: Boolean
+
+**Examples**: Given that the "abc" attribute contains the value "hello world",
+"xyz" contains "good bye world", and "filename" contains "file.txt" consider
+the following examples:
+
+| Expression | Value |
+| - | - |
+| `${allAttributes("abc",