Changeset 87:819d8b155771 in xplra


Ignore:
Timestamp:
05/12/13 09:02:44 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

Added the C and C++ calls to save the current situation

Location:
src/client/c/hu/varadiistvan/xplra
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/XPlane.cc

    r57 r87  
    246246//------------------------------------------------------------------------------
    247247
     248void XPlane::saveSituation(const char* path) throw(Exception)
     249{
     250    stream->writeU8(Protocol::COMMAND_SAVE_SITUATION);
     251    stream->writeString(path);
     252    stream->flush();
     253    checkResult();
     254}
     255
     256//------------------------------------------------------------------------------
     257
    248258void XPlane::getScalar(const char* name, uint8_t type) throw(Exception)
    249259{
  • src/client/c/hu/varadiistvan/xplra/XPlane.h

    r66 r87  
    156156
    157157    /**
     158     * Save the current situation into the file with the given path,
     159     * which is relative to the directory of X-Plane.
     160     */
     161    void saveSituation(const char* path) throw(Exception);
     162
     163    /**
    158164     * Get the integer value of the dataref with the given name.
    159165     */
  • src/client/c/hu/varadiistvan/xplra/xplra.cc

    r70 r87  
    530530//------------------------------------------------------------------------------
    531531
     532extern "C" int xplra_save_situation(int connectionID, const char* path)
     533{
     534    Connection* connection = ConnectionSlot::getValue(connectionID);
     535    if (connection==0) return -1;
     536    try {
     537        connection->saveSituation(path);
     538        return 0;
     539    } catch (...) {
     540        connection->handleException();
     541        return -1;
     542    }
     543}
     544
     545//------------------------------------------------------------------------------
     546
    532547extern "C" int xplra_get_int(int* value, int connectionID, const char* name)
    533548{
  • src/client/c/hu/varadiistvan/xplra/xplra.h

    r70 r87  
    165165
    166166/*----------------------------------------------------------------------------*/
     167
     168/**
     169 * Save the current situation into the file with the given path
     170 * relative to X-Plane's directory.
     171 */
     172int xplra_save_situation(int connectionID, const char* path);
     173
     174/*----------------------------------------------------------------------------*/
    167175/* Single dataref support                                                     */
    168176/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.