Skip to content
Snippets Groups Projects
Commit 64243c85 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added string_contains()

parent fe708a94
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@
#include "arithmetic.h"
static void
detrendGetParameter(bool &tstepIsEqual)
get_parameter(bool &tstepIsEqual)
{
auto pargc = cdo_operator_argc();
if (pargc)
......@@ -88,7 +88,7 @@ public:
void
init() override
{
detrendGetParameter(tstepIsEqual);
get_parameter(tstepIsEqual);
streamID1 = cdo_open_read(0);
......
......@@ -155,7 +155,7 @@ printWeightsWarning(int ngrids, const std::string &varname)
}
static void
fldstatGetParameter(bool &useWeights)
get_parameter(bool &useWeights)
{
auto pargc = cdo_operator_argc();
if (pargc)
......@@ -280,10 +280,11 @@ public:
if (operfunc == FieldFunc_Pctl)
{
operator_check_argc(1);
operator_input_arg("percentile number");
pn = parameter_to_double(cdo_operator_argv(0));
}
else if (needWeights) { fldstatGetParameter(useWeights); }
else if (needWeights) { get_parameter(useWeights); }
else { operator_check_argc(0); }
streamID1 = cdo_open_read(0);
......
......@@ -28,7 +28,7 @@
#include "arithmetic.h"
static void
trendGetParameter(bool &tstepIsEqual)
get_parameter(bool &tstepIsEqual)
{
auto pargc = cdo_operator_argc();
if (pargc)
......@@ -90,7 +90,7 @@ public:
void
init() override
{
trendGetParameter(tstepIsEqual);
get_parameter(tstepIsEqual);
streamID1 = cdo_open_read(0);
......
......@@ -68,7 +68,7 @@ sub_trend(double zj, Field &field1, const Field &field2, const Field &field3)
}
static void
trendarithGetParameter(bool &tstepIsEqual)
get_parameter(bool &tstepIsEqual)
{
auto pargc = cdo_operator_argc();
if (pargc)
......@@ -135,7 +135,7 @@ public:
operfunc = cdo_operator_f1(operatorID);
tstepIsEqual = true;
trendarithGetParameter(tstepIsEqual);
get_parameter(tstepIsEqual);
streamID1 = cdo_open_read(0);
streamID2 = cdo_open_read(1);
......
......@@ -55,6 +55,12 @@ string_format(const std::string &format, Args... args)
return std::string(buf.get(), static_cast<char *>(buf.get()) + size - 1); // We don't want the '\0' inside
}
inline bool
string_contains(const std::string &s, unsigned char ch)
{
return (s.find(ch) != std::string::npos);
}
namespace Util
{
namespace String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment