Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualgreeniekin

Posted 08 October 2012 - 07:26 AM

I have been using sfml libraries and it's string class.

I really want to keep using the sfml string class though it will not work with the angelscript std string addon.

Even though if the string class is given a stdString in c++ it will convert it.

I have tried modifying the angelscript std string add on for sfml string(with some changes to sfml string)

Like the following error

error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const sf::String&, const sf::String&)'|
for the following
r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(operator ==, (const sf::String &, const sf::String &), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );

I know I can not expect you to write it or fix mine so I just have a few questions

I have not really read anything about alternative to the std string addon anywhere. I was wondering if there might be some other examples I can look at.

Also internally sfml String uses a std::basic_string<Uint32> to store the string. the functions that i would expose to script would be like this

int XUIElement::getAttributeInt(sf::String searchName)

Is there a way this could be used to simplify the process. I am not really sure if  std string addon needs to be modified for using this type of string as opposed to just a uint8 char.

#1greeniekin

Posted 08 October 2012 - 06:35 AM

I have been using sfml libraries and it's string class.

I really want to keep using the sfml string class though it will not work with the angelscript std string addon.

Even though if the string class is given a stdString in c++ it will convert it.

I have tried modifying the angelscript std string add on for sfml string(with some changes to sfml string)

Like the following error

error: invalid static_cast from type '<unresolved overloaded function type>' to type 'bool (*)(const sf::String&, const sf::String&)'|
for the following
r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(operator ==, (const sf::String &, const sf::String &), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );

I know I can not expect you to write it or fix mine so I just have a few questions

I have not really read anything about alternative to the std string addon anywhere. I was wondering if there might be some other examples I can look at.

Also internally sfml String uses a std::basic_string<Uint32> to store the string. the functions that i would expose to script would be like this

int XUIElement::getAttributeInt(sf::String searchName)

Is there a way this could be used to simplify the process. I am not really sure if  std string addon needs to be modified for using this type of string as opposed to just a char.

PARTNERS