Pass the format string for the ephemeris conversion as a string_view to prevent an extra memory allocation

This commit is contained in:
Alexander Bock
2020-08-19 11:12:45 +02:00
parent 0ae699e345
commit 2621e16ec4
2 changed files with 37 additions and 9 deletions
+6 -3
View File
@@ -469,15 +469,18 @@ public:
*
* \param ephemerisTime The ephemeris time, that is the number of TDB seconds past the
* J2000 epoch
* \param formatString The format string describing the output format
* \param format The format string describing the output format
* \return The destination for the converted date.
*
* \pre \p formatString must not be empty
* \pre \p format must not be empty
*
* \sa http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html
*/
std::string dateFromEphemerisTime(double ephemerisTime,
const std::string& formatString = "YYYY MON DDTHR:MN:SC.### ::RND") const;
std::string_view format = "YYYY MON DDTHR:MN:SC.### ::RND") const;
void dateFromEphemerisTime(double ephemerisTime, char* outBuf, int bufferSize,
std::string_view format = "YYYY MON DDTHR:MN:SC.### ::RND") const;
/**
* Returns the \p position of a \p target body relative to an \p observer in a