//------------------------------------------------------------------------------
// <copyright file="FCCMessage_Utilities.h" company="LiquidRobotics">
//
// Copyright (c) 2014 Liquid Robotics, Inc.
//
// 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 software is associated with a release.  Liquid Robotics makes no
// representation that the design, interfaces or component distribution will
// remain unchanged in future releases.
//
// </copyright>
//
// <summary>
//   Declarations for some utility functions relative to the Float C&C message
//   set types
// </summary>
//
// <owner>Mike Cookson</owner>
//------------------------------------------------------------------------------

#ifndef FCCMESSAGE_UTILITIES_H_
#define FCCMESSAGE_UTILITIES_H_

#include "FCCMessage.h"
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "LqrSMACSharedLib.h"

namespace LiquidRobotics {
namespace PayloadInterface {
namespace FCCMessage {

#pragma pack(push,1)
typedef struct _REPORTED_NAME_
{
	char paddedFileName[11];
} REPORTED_NAME, *PREPORTED_NAME;
#pragma pack(pop)

SHARED_LIB_PUBLIC void Convert(const DATE_TIME& input, boost::posix_time::ptime& output);
SHARED_LIB_PUBLIC void Convert(const boost::posix_time::ptime& input, DATE_TIME& output);
SHARED_LIB_PUBLIC std::string ReportedToRealName(const REPORTED_NAME& reportedName);
SHARED_LIB_PUBLIC std::string ReportedStrToRealName(const std::string& reportedName);
SHARED_LIB_PUBLIC REPORTED_NAME RealNameToReported(const std::string& realName);
SHARED_LIB_PUBLIC std::string RealNameToReportedStr(const std::string& realName);
SHARED_LIB_PUBLIC std::string Stringize(const REPORTED_NAME& reportedName);
SHARED_LIB_PUBLIC REPORTED_NAME Unstringize(const std::string& reportedName);

}
}
}


#endif /* FCCMESSAGE_UTILITIES_H_ */
