git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4687 626c5289-ae23-0410-ae9c-e8d60b6d4f22
37 lines
780 B
C++
37 lines
780 B
C++
/* -*- mode: c++ -*- */
|
|
/* File : example.h -- Tests all string typemaps */
|
|
|
|
void takes_std_string( std::string in ) {
|
|
cout << "takes_std_string( \"" << in << "\" );" << endl;
|
|
}
|
|
|
|
std::string gives_std_string() {
|
|
time_t t;
|
|
|
|
return std::string( asctime( localtime( &t ) ) );
|
|
}
|
|
|
|
void takes_char_ptr( char *p ) {
|
|
cout << "takes_char_ptr( \"" << p << "\" );" << endl;
|
|
}
|
|
|
|
char *gives_char_ptr() {
|
|
return "foo";
|
|
}
|
|
|
|
void takes_and_gives_std_string( std::string &inout ) {
|
|
inout.insert( inout.begin(), '[' );
|
|
inout.insert( inout.end(), ']' );
|
|
}
|
|
|
|
void takes_and_gives_char_ptr( char *&ptr ) {
|
|
char *pout = strchr( ptr, '.' );
|
|
if( pout ) ptr = pout + 1;
|
|
else ptr = "foo";
|
|
}
|
|
|
|
/*
|
|
* Local-Variables:
|
|
* c-indentation-style: "stroustrup"
|
|
* End:
|
|
*/
|