@@ -487,12 +487,12 @@ namespace
487487
488488 void invalidPatternException (std::string_view pattern, Callbacks* cb)
489489 {
490- cb->err (Arg::Gds (isc_invalid_date_format) << string ( pattern. data (), pattern. length ()) );
490+ cb->err (Arg::Gds (isc_invalid_date_format) << pattern);
491491 }
492492
493493 void incompatibleDateFormatException (std::string_view pattern, Callbacks* cb)
494494 {
495- cb->err (Arg::Gds (isc_incompatible_date_format_with_current_date_type) << string ( pattern. data (), pattern. length ()) );
495+ cb->err (Arg::Gds (isc_incompatible_date_format_with_current_date_type) << pattern);
496496 }
497497
498498 // -----------------------------------------------------------------------------------------------------------------
@@ -915,7 +915,7 @@ namespace
915915
916916 if (format[0 ] == ' \" ' )
917917 {
918- patternResult.resize (format.length (), ' \0 ' );
918+ patternResult.resize (static_cast <string::size_type>( format.length () ), ' \0 ' );
919919 for (FB_SIZE_T i = 1 , j = 0 ; i < format.length (); i++, j++)
920920 {
921921 if (format[i] == ' \" ' )
@@ -928,7 +928,7 @@ namespace
928928 patternResult.recalculate_length ();
929929 }
930930 else
931- patternResult.assign (format. data (), format. length () );
931+ patternResult.assign (format);
932932 break ;
933933 }
934934
@@ -951,7 +951,7 @@ namespace
951951 void throwExceptionOnEmptyValue (std::optional<T> value, std::string_view pattern, Callbacks* cb)
952952 {
953953 if (!value.has_value ())
954- cb->err (Arg::Gds (isc_missing_value_for_format_pattern) << string ( pattern. data (), pattern. length ()) );
954+ cb->err (Arg::Gds (isc_missing_value_for_format_pattern) << pattern);
955955 }
956956
957957 std::vector<Token> parseStringToDateTimeFormat (const dsc* desc, const string& formatUpper, Format::Patterns& outFormatPatterns, Callbacks* cb)
@@ -982,7 +982,7 @@ namespace
982982 if (pattern == Format::NONE)
983983 invalidPatternException (patternStr, cb);
984984 if (outFormatPatterns & pattern)
985- cb->err (Arg::Gds (isc_can_not_use_same_pattern_twice) << string ( patternStr. data (), patternStr. length ()) );
985+ cb->err (Arg::Gds (isc_can_not_use_same_pattern_twice) << patternStr);
986986 if (!patternIsCompatibleWithDscType (desc, pattern))
987987 incompatibleDateFormatException (patternStr, cb);
988988
@@ -1136,7 +1136,7 @@ namespace
11361136 else if (period == FormatStr::PM)
11371137 return twelveHours == 12 ? twelveHours : 12 + twelveHours;
11381138
1139- cb->err (Arg::Gds (isc_incorrect_hours_period) << string ( period. data (), period. length ()) );
1139+ cb->err (Arg::Gds (isc_incorrect_hours_period) << period);
11401140 return 0 ; // suppress compiler warning/error
11411141 }
11421142
@@ -1275,8 +1275,8 @@ namespace
12751275
12761276 if (minutes.value () > 59 )
12771277 {
1278- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1279- string (patternStr. data (), patternStr. length ()) << Arg::Num ( 0 ) << Arg::Num (59 ));
1278+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr << Arg::Num ( 0 ) <<
1279+ Arg::Num (59 ));
12801280 }
12811281
12821282 if (!TimeZoneUtil::isValidOffset (sign, hours.value (), minutes.value ()))
@@ -1398,8 +1398,8 @@ namespace
13981398
13991399 if (year > 9999 )
14001400 {
1401- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1402- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (9999 ));
1401+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1402+ Arg::Num (0 ) << Arg::Num (9999 ));
14031403 }
14041404 outTimes.tm_year = year.value () - 1900 ;
14051405 break ;
@@ -1411,8 +1411,8 @@ namespace
14111411
14121412 if (minutes > 59 )
14131413 {
1414- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1415- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (59 ));
1414+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1415+ Arg::Num (0 ) << Arg::Num (59 ));
14161416 }
14171417
14181418 outTimes.tm_min = minutes.value ();
@@ -1425,8 +1425,8 @@ namespace
14251425
14261426 if (month < 1 || month > 12 )
14271427 {
1428- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1429- string (patternStr. data (), patternStr. length ()) << Arg::Num (1 ) << Arg::Num (12 ));
1428+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1429+ Arg::Num (1 ) << Arg::Num (12 ));
14301430 }
14311431
14321432 outTimes.tm_mon = month.value () - 1 ;
@@ -1450,7 +1450,7 @@ namespace
14501450 }
14511451
14521452 if (!isFound)
1453- cb->err (Arg::Gds (isc_month_name_mismatch) << string ( monthShortName. data (), monthShortName. length ()) );
1453+ cb->err (Arg::Gds (isc_month_name_mismatch) << monthShortName);
14541454 break ;
14551455 }
14561456 case Format::MONTH:
@@ -1471,7 +1471,7 @@ namespace
14711471 }
14721472
14731473 if (!isFound)
1474- cb->err (Arg::Gds (isc_month_name_mismatch) << string ( monthFullName. data (), monthFullName. length ()) );
1474+ cb->err (Arg::Gds (isc_month_name_mismatch) << monthFullName);
14751475 break ;
14761476 }
14771477
@@ -1503,8 +1503,8 @@ namespace
15031503 const int month = romanToInt (str, strLength, strOffset);
15041504 if (month == 0 || month > 12 )
15051505 {
1506- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1507- string (patternStr. data (), patternStr. length ()) << Arg::Num (1 ) << Arg::Num (12 ));
1506+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1507+ Arg::Num (1 ) << Arg::Num (12 ));
15081508 }
15091509
15101510 outTimes.tm_mon = month - 1 ;
@@ -1518,8 +1518,8 @@ namespace
15181518
15191519 if (day == 0 || day > 31 )
15201520 {
1521- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1522- string (patternStr. data (), patternStr. length ()) << Arg::Num (1 ) << Arg::Num (31 ));
1521+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1522+ Arg::Num (1 ) << Arg::Num (31 ));
15231523 }
15241524
15251525 outTimes.tm_mday = day.value ();
@@ -1535,8 +1535,8 @@ namespace
15351535 constexpr int maxJDN = 5373484 ; // 31.12.9999
15361536 if (JDN < minJDN || JDN > maxJDN)
15371537 {
1538- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1539- string (patternStr. data (), patternStr. length ()) << Arg::Num (minJDN) << Arg::Num (maxJDN));
1538+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1539+ Arg::Num (minJDN) << Arg::Num (maxJDN));
15401540 }
15411541
15421542 int year = 0 , month = 0 , day = 0 ;
@@ -1555,8 +1555,8 @@ namespace
15551555
15561556 if (hours < 1 || hours > 12 )
15571557 {
1558- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1559- string (patternStr. data (), patternStr. length ()) << Arg::Num (1 ) << Arg::Num (12 ));
1558+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1559+ Arg::Num (1 ) << Arg::Num (12 ));
15601560 }
15611561
15621562 outTimes.tm_hour = hours.value ();
@@ -1569,8 +1569,8 @@ namespace
15691569
15701570 if (hours > 23 )
15711571 {
1572- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1573- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (23 ));
1572+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1573+ Arg::Num (0 ) << Arg::Num (23 ));
15741574 }
15751575
15761576 outTimes.tm_hour = hours.value ();
@@ -1584,8 +1584,8 @@ namespace
15841584
15851585 if (seconds > 59 )
15861586 {
1587- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1588- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (59 ));
1587+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1588+ Arg::Num (0 ) << Arg::Num (59 ));
15891589 }
15901590
15911591 outTimes.tm_sec = seconds.value ();
@@ -1601,8 +1601,8 @@ namespace
16011601 const int secondsInDayValue = secondsInDay.value ();
16021602 if (secondsInDayValue > maximumSecondsInDay)
16031603 {
1604- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1605- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (maximumSecondsInDay));
1604+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1605+ Arg::Num (0 ) << Arg::Num (maximumSecondsInDay));
16061606 }
16071607
16081608 const int hours = secondsInDayValue / 24 ;
@@ -1677,8 +1677,8 @@ namespace
16771677
16781678 if (minutes > 59 )
16791679 {
1680- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1681- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (59 ));
1680+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1681+ Arg::Num (0 ) << Arg::Num (59 ));
16821682 }
16831683
16841684 outTimezoneInMinutes += sign (outTimezoneInMinutes) * minutes.value ();
@@ -1691,8 +1691,8 @@ namespace
16911691 const int minutesValue = minutes.value ();
16921692 if (abs (minutesValue) > 59 )
16931693 {
1694- cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) <<
1695- string (patternStr. data (), patternStr. length ()) << Arg::Num (0 ) << Arg::Num (59 ));
1694+ cb->err (Arg::Gds (isc_value_for_pattern_is_out_of_range) << patternStr <<
1695+ Arg::Num (0 ) << Arg::Num (59 ));
16961696 }
16971697
16981698 outTimezoneInMinutes = minutesValue;
@@ -1717,8 +1717,8 @@ namespace
17171717 }
17181718
17191719 std::string_view timezoneName = getTimezoneNameFromString (str, strLength, oldOffset);
1720- status_exception::raise (Arg::Gds (isc_invalid_timezone_region_or_displacement)
1721- << string ( timezoneName. data (), timezoneName. length ()) );
1720+ status_exception::raise (
1721+ Arg::Gds (isc_invalid_timezone_region_or_displacement) << timezoneName);
17221722 }
17231723
17241724 strOffset += parsedTimezoneNameLength;
0 commit comments