00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <unoglobal.hxx>
00029 #include <iostream>
00030 #include <com/sun/star/lang/XServiceInfo.hpp>
00031 #include <com/sun/star/table/CellAddress.hpp>
00032
00033 using ::com::sun::star::uno::Any;
00034
00035 namespace scsolver {
00036
00037 void printOUStr( const rtl::OUString & ou )
00038 {
00039 rtl::OString o = OUStringToOString( ou, RTL_TEXTENCODING_UTF8 );
00040 std::cout << o.getStr() << std::endl;
00041 }
00042
00043 const ::rtl::OUString ascii(const sal_Char* text)
00044 {
00045 return rtl::OUString::createFromAscii(text);
00046 }
00047
00048 const Any asciiAny(const sal_Char* text)
00049 {
00050 Any any;
00051 any <<= ascii(text);
00052 return any;
00053 }
00054
00062 void split( const rtl::OUString& sStr, const rtl::OUString& sSep,
00063 std::vector<rtl::OUString>& cn )
00064 {
00065 sal_Int32 nLenSep = sSep.getLength();
00066 sal_Int32 nPos = sStr.indexOf( sSep );
00067 sal_Int32 nStart = 0;
00068
00069 while ( nPos > -1 )
00070 {
00071 rtl::OUString s = sStr.copy( nStart, nPos - nStart );
00072 nStart = nPos + nLenSep;
00073 nPos = sStr.indexOf( sSep, nStart );
00074 cn.push_back( s );
00075 }
00076 rtl::OUString s = sStr.copy( nStart );
00077 cn.push_back( s );
00078 }
00079
00080
00081
00082
00083 const rtl::OUString Global::STRING_SEPARATOR = ascii( "," );
00084 const rtl::OUString Global::MODEL_METADATA_NAME = ascii( "us.kohei.ooo.solver:model" );
00085
00086 RuntimeError::RuntimeError( const rtl::OUString& umsg ) :
00087 m_sUniMsg( umsg )
00088 {
00089 }
00090
00091 RuntimeError::~RuntimeError() throw()
00092 {
00093 }
00094
00095 const char* RuntimeError::what() const throw()
00096 {
00097 rtl::OString o = OUStringToOString(m_sUniMsg, RTL_TEXTENCODING_UTF8);
00098 return o.getStr();
00099 }
00100
00101 const rtl::OUString RuntimeError::getMessage() const throw()
00102 {
00103 return m_sUniMsg;
00104 }
00105
00106
00107 }
00108
00109
00110