Add convstr to YaSp
[scilab.git] / scilab / modules / string / sci_gateway / cpp / string_gw.cpp
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2010-2010 - DIGITEO - Antoine ELIAS
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12
13 #include "string_gw.hxx"
14 extern "C"
15 {
16     #include "gw_string.h"
17 }
18
19 #define MODULE_NAME L"string"
20
21 bool StringModule::Load()
22 {
23     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"grep", &sci_grep, MODULE_NAME));
24     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"stripblanks", &sci_stripblanks, MODULE_NAME));
25     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"regexp", &sci_regexp, MODULE_NAME));
26     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"part", &sci_part, MODULE_NAME));
27     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"length", &sci_length, MODULE_NAME));
28     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strindex", &sci_strindex, MODULE_NAME));
29     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strsubst", &sci_strsubst, MODULE_NAME));
30     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strsplit", &sci_strsplit, MODULE_NAME));
31     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ascii", &sci_ascii, MODULE_NAME));
32     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strcat", &sci_strcat, MODULE_NAME));
33     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"string", &sci_string, MODULE_NAME));
34     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"convstr", &sci_convstr, MODULE_NAME));
35     return true;
36 }