Skip to content

Commit ef171bf

Browse files
committed
Add documentation and remove some noexcept
1 parent 0c27db0 commit ef171bf

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

src/xtd.core/include/xtd/globalization/date_time_format_info.hpp

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,34 @@ namespace xtd {
6565
/// @brief Sets a one-dimensional array of type String containing the culture-specific abbreviated names of the days of the week.
6666
/// @param value A one-dimensional array of type xtd::string containing the culture-specific abbreviated names of the days of the week. The array for xtd::globalization::date_time_format_info::invariant_info contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", and "Sat".
6767
/// @exception xtd::argument_exception The property is being set to an array that has a length that is not exactly 7.
68-
auto abreviated_day_names(const xtd::array<xtd::string>& value) noexcept -> xtd::globalization::date_time_format_info&;
68+
auto abreviated_day_names(const xtd::array<xtd::string>& value) -> xtd::globalization::date_time_format_info&;
6969

70+
/// @brief Gets a string array of abbreviated month names associated with the current xtd::globalization::date_time_format_info object.
71+
/// @return An array of abbreviated month names.
7072
[[nodiscard]] auto abreviated_month_genitive_names() const noexcept -> const xtd::array<xtd::string>& ;
71-
auto abreviated_month_genitive_names(const xtd::array<xtd::string>& value) noexcept -> xtd::globalization::date_time_format_info&;
72-
73+
/// @brief Sets a string array of abbreviated month names associated with the current xtd::globalization::date_time_format_info object.
74+
/// @param value An array of abbreviated month names.
75+
/// @exception xtd::argument_exception The property is being set to an array that has a length that is not exactly 13.
76+
auto abreviated_month_genitive_names(const xtd::array<xtd::string>& value) -> xtd::globalization::date_time_format_info&;
77+
78+
/// @brief Gets or a one-dimensional string array that contains the culture-specific abbreviated names of the months.
79+
/// @return A one-dimensional string array with 13 elements that contains the culture-specific abbreviated names of the months. For 12-month calendars, the 13th element of the array is an empty string. The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "".
7380
[[nodiscard]] auto abreviated_month_names() const noexcept -> const xtd::array<xtd::string>& ;
74-
auto abreviated_month_names(const xtd::array<xtd::string>& value) noexcept -> xtd::globalization::date_time_format_info&;
75-
81+
/// @brief Sets or a one-dimensional string array that contains the culture-specific abbreviated names of the months.
82+
/// @oaram value A one-dimensional string array with 13 elements that contains the culture-specific abbreviated names of the months. For 12-month calendars, the 13th element of the array is an empty string. The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "".
83+
/// @exception xtd::argument_exception The property is being set to an array that has a length that is not exactly 13.
84+
auto abreviated_month_names(const xtd::array<xtd::string>& value) -> xtd::globalization::date_time_format_info&;
85+
86+
/// @brief Gets the string designator for hours that are "ante meridiem" (before noon).
87+
/// @return The string designator for hours that are ante meridiem. The default for InvariantInfo is "AM".
88+
/// @remarks The xtd::globalization::date_time_format_info::am_designator property is used for all times from 0:00:00 (midnight) to 11:59:59.999.
89+
/// @remarks If a custom format string includes the "tt" format specifier and the time is before noon, the xtd::date_time::to_string method includes the value of the xtd::globalization::date_time_format_info::am_designator property in place of "tt" in the result string. If the custom format string includes the "t" custom format specifier, only the first character of the xtd::globalization::date_time_format_info::am_designator property value is included. You should use "tt" for languages for which it is necessary to maintain the distinction between A.M. and P.M. An example is Japanese, in which the A.M. and P.M. designators differ in the second character instead of the first character.
90+
/// @remarks For cultures that do not use an A.M. designator, this property returns an empty string.
7691
[[nodiscard]] auto am_designator() const noexcept -> const xtd::string&;
92+
/// @brief Sets the string designator for hours that are "ante meridiem" (before noon).
93+
/// @param value The string designator for hours that are ante meridiem. The default for InvariantInfo is "AM".
94+
/// @remarks If a custom format string includes the "tt" format specifier and the time is before noon, the xtd::date_time::to_string method includes the value of the xtd::globalization::date_time_format_info::am_designator property in place of "tt" in the result string. If the custom format string includes the "t" custom format specifier, only the first character of the xtd::globalization::date_time_format_info::am_designator property value is included. You should use "tt" for languages for which it is necessary to maintain the distinction between A.M. and P.M. An example is Japanese, in which the A.M. and P.M. designators differ in the second character instead of the first character.
95+
/// @remarks For cultures that do not use an A.M. designator, this property returns an empty string.
7796
auto am_designator(const xtd::string& value) noexcept -> xtd::globalization::date_time_format_info&;
7897

7998
[[nodiscard]] auto date_separator() const noexcept -> const xtd::string&;
@@ -137,8 +156,14 @@ namespace xtd {
137156
/// @name Public Static Properties
138157

139158
/// @{
159+
/// @brief Gets a read-only xtd::globalization::date_time_format_info object that formats values based on the current culture.
160+
/// @return A read-only xtd::globalization::date_time_format_info object based on the xtd::globalization::culture_info object for the current thread.
161+
/// @remarks The xtd::globalization::date_time_format_info object returned by the xtd::globalization::date_time_format_info::current_info property reflects user overrides.
140162
[[nodiscard]] static auto current_info() noexcept -> const xtd::globalization::date_time_format_info&;
141-
163+
164+
/// @brief Gets the default read-only xtd::globalization::date_time_format_info object that is culture-independent (invariant).
165+
/// @return A read-only object that is culture-independent (invariant).
166+
/// @remarks This property does not change, regardless of the current culture. Because of this, the invariant culture's xtd::globalization::date_time_format_info object can be used to produce consistent, culture-independent results in parsing and formatting operations on data that is multi-cultural. For example, if date and time data from multiple cultures is to be persisted in string form, it can be formatted by using the xtd::globalization::date_time_format_info object of the invariant culture and saved. It can then be parsed by using the invariant culture's xtd::globalization::date_time_format_info object.
142167
[[nodiscard]] static auto invariant_info() noexcept -> const xtd::globalization::date_time_format_info&;
143168
/// @}
144169

src/xtd.core/src/xtd/globalization/date_time_format_info.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ auto date_time_format_info::abreviated_day_names() const noexcept -> const array
5050
return data_->abreviated_day_names;
5151
}
5252

53-
auto date_time_format_info::abreviated_day_names(const array<string>& value) noexcept -> date_time_format_info& {
53+
auto date_time_format_info::abreviated_day_names(const array<string>& value) -> date_time_format_info& {
5454
if (value.length() != 7_z) throw_helper::throws(xtd::helpers::exception_case::argument);
5555
data_->abreviated_day_names = value;
5656
return self_;
@@ -60,7 +60,8 @@ auto date_time_format_info::abreviated_month_genitive_names() const noexcept ->
6060
return data_->abreviated_month_genitive_names;
6161
}
6262

63-
auto date_time_format_info::abreviated_month_genitive_names(const array<string>& value) noexcept -> date_time_format_info& {
63+
auto date_time_format_info::abreviated_month_genitive_names(const array<string>& value) -> date_time_format_info& {
64+
if (value.length() != 13_z) throw_helper::throws(xtd::helpers::exception_case::argument);
6465
data_->abreviated_month_genitive_names = value;
6566
return self_;
6667
}
@@ -69,7 +70,8 @@ auto date_time_format_info::abreviated_month_names() const noexcept -> const arr
6970
return data_->abreviated_month_names;
7071
}
7172

72-
auto date_time_format_info::abreviated_month_names(const array<string>& value) noexcept -> date_time_format_info& {
73+
auto date_time_format_info::abreviated_month_names(const array<string>& value) -> date_time_format_info& {
74+
if (value.length() != 13_z) throw_helper::throws(xtd::helpers::exception_case::argument);
7375
data_->abreviated_month_names = value;
7476
return self_;
7577
}

0 commit comments

Comments
 (0)