Add SGPath to the Nasal conversion helpers.
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
#include "from_nasal_detail.hxx"
|
#include "from_nasal_detail.hxx"
|
||||||
#include "NasalHash.hxx"
|
#include "NasalHash.hxx"
|
||||||
|
|
||||||
|
#include <simgear/misc/sg_path.hxx>
|
||||||
|
|
||||||
namespace nasal
|
namespace nasal
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -53,6 +55,12 @@ namespace nasal
|
|||||||
return std::string(naStr_data(na_str), naStr_len(na_str));
|
return std::string(naStr_data(na_str), naStr_len(na_str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SGPath from_nasal_helper(naContext c, naRef ref, SGPath*)
|
||||||
|
{
|
||||||
|
naRef na_str = naStringValue(c, ref);
|
||||||
|
return SGPath(std::string(naStr_data(na_str), naStr_len(na_str)));
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
Hash from_nasal_helper(naContext c, naRef ref, Hash*)
|
Hash from_nasal_helper(naContext c, naRef ref, Hash*)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#include <typeinfo> // std::bad_cast
|
#include <typeinfo> // std::bad_cast
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class SGPath;
|
||||||
|
|
||||||
namespace nasal
|
namespace nasal
|
||||||
{
|
{
|
||||||
class Hash;
|
class Hash;
|
||||||
@@ -75,6 +77,11 @@ namespace nasal
|
|||||||
*/
|
*/
|
||||||
std::string from_nasal_helper(naContext c, naRef ref, std::string*);
|
std::string from_nasal_helper(naContext c, naRef ref, std::string*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a Nasal string to an SGPath
|
||||||
|
*/
|
||||||
|
SGPath from_nasal_helper(naContext c, naRef ref, SGPath*);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a Nasal hash to a nasal::Hash
|
* Convert a Nasal hash to a nasal::Hash
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
#include "to_nasal.hxx"
|
#include "to_nasal.hxx"
|
||||||
#include "NasalHash.hxx"
|
#include "NasalHash.hxx"
|
||||||
|
|
||||||
|
#include <simgear/misc/sg_path.hxx>
|
||||||
|
|
||||||
namespace nasal
|
namespace nasal
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -53,4 +55,9 @@ namespace nasal
|
|||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
naRef to_nasal(naContext c, const SGPath& path)
|
||||||
|
{
|
||||||
|
return to_nasal(c, path.str());
|
||||||
|
}
|
||||||
} // namespace nasal
|
} // namespace nasal
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
class SGPath;
|
||||||
|
|
||||||
namespace nasal
|
namespace nasal
|
||||||
{
|
{
|
||||||
class Hash;
|
class Hash;
|
||||||
@@ -60,6 +62,8 @@ namespace nasal
|
|||||||
*/
|
*/
|
||||||
naRef to_nasal(naContext c, naRef ref);
|
naRef to_nasal(naContext c, naRef ref);
|
||||||
|
|
||||||
|
naRef to_nasal(naContext c, const SGPath& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a numeric type to Nasal number
|
* Convert a numeric type to Nasal number
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user