comparison libinterp/octave-value/ov-java.cc @ 20651:b22528fd3deb

Add placeholder functions for save_ascii, save_binary for octave_java (bug #45694). * ov-java.h: (save_ascii, load_ascii, save_binary, load_binary): New function prototypes overriding defaults in ov.h. * ov-java.cc (save_ascii, save_binary): New functions emit warning about inability to save java objects, and then return true so that other variables can be saved. * ov-java.cc (load_ascii, load_binary): New functions silently skip over null octave_java elements in a file produced by save_ascii() or save_binary().
author Rik <rik@octave.org>
date Thu, 13 Aug 2015 22:00:02 -0700
parents 4262598620ae
children 2f94652de9ff
comparison
equal deleted inserted replaced
20650:3fc21d7ac11c 20651:b22528fd3deb
1844 octave_java::print_raw (std::ostream& os, bool) const 1844 octave_java::print_raw (std::ostream& os, bool) const
1845 { 1845 {
1846 os << "<Java object: " << java_classname << ">"; 1846 os << "<Java object: " << java_classname << ">";
1847 } 1847 }
1848 1848
1849 // FIXME: Need routines to actually save/load java objects through Serialize.
1850 // See bug #42112.
1851
1852 bool
1853 octave_java::save_ascii (std::ostream& /* os */)
1854 {
1855 warning ("save: unable to save java objects, skipping");
1856
1857 return true;
1858 }
1859
1860 bool
1861 octave_java::load_ascii (std::istream& /* is */)
1862 {
1863 // Silently skip over java object that was not saved
1864 return true;
1865 }
1866
1867 bool
1868 octave_java::save_binary (std::ostream& /* os */, bool& /* save_as_floats */)
1869 {
1870 warning ("save: unable to save java objects, skipping");
1871
1872 return true;
1873 }
1874
1875 bool
1876 octave_java::load_binary (std::istream& /* is */, bool /* swap*/,
1877 oct_mach_info::float_format /* fmt */)
1878 {
1879 // Silently skip over java object that was not saved
1880 return true;
1881 }
1882
1849 octave_value 1883 octave_value
1850 octave_java::do_javaMethod (JNIEnv* jni_env, const std::string& name, 1884 octave_java::do_javaMethod (JNIEnv* jni_env, const std::string& name,
1851 const octave_value_list& args) 1885 const octave_value_list& args)
1852 { 1886 {
1853 octave_value retval; 1887 octave_value retval;