forked from loafle/openapi-generator-original
Issue 4632 (#4803)
* Updated the Petstore samples * This change uses std::stringstream for string conversions instead of std::to_string(). Android doesn't yet support std::to_string(). This should fix #4632
This commit is contained in:
@@ -33,11 +33,15 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int64_t value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int32_t value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
|
||||
utility::string_t ApiClient::parameterToString(float value)
|
||||
|
||||
@@ -118,7 +118,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType )
|
||||
@@ -127,7 +129,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream) ) ;
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType )
|
||||
@@ -136,7 +140,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user