Created
August 12, 2012 03:46
-
-
Save dcolish/3329499 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define XAPIAN_TERMITERATOR_PAIR_OUTPUT_TYPEMAP | |
| %typemap(out) std::pair<Xapian::TermIterator, Xapian::TermIterator> { | |
| jstring temp_string; | |
| const jclass clazz = jenv->FindClass("java/lang/String"); | |
| int n = 0; | |
| list<string> tmp_list; | |
| for (Xapian::TermIterator i = .first; i != .second; ++i) { | |
| tmp_list.push_back((*i).data()); | |
| } | |
| = jenv->NewObjectArray(tmp_list.size(), clazz, NULL); | |
| for (list<string>::iterator j = tmp_list.begin(); j != tmp_list.end(); ++j) { | |
| temp_string = jenv->NewStringUTF((*j).c_str()); | |
| jenv->SetObjectArrayElement(, n, temp_string); | |
| jenv->DeleteLocalRef(temp_string); | |
| ++n; | |
| } | |
| } | |
| %typemap(jni) std::pair<Xapian::TermIterator, Xapian::TermIterator> "jobjectArray" | |
| %typemap(jtype) std::pair<Xapian::TermIterator, Xapian::TermIterator> "String[]" | |
| %typemap(jstype) std::pair<Xapian::TermIterator, Xapian::TermIterator> "String[]" | |
| /* This typemap handles the conversion of the jstype to the jtype. */ | |
| %typemap(javaout) std::pair<Xapian::TermIterator, Xapian::TermIterator> { return ;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment