2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET
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
18 symbol::Symbol::string_set_type symbol::Symbol::_set;
23 Symbol::Symbol (const std::wstring &s):
24 _set_node (_set.insert(s).first)
29 const std::wstring& Symbol::name_get () const
34 // Return the size of the Symbol map.
35 Symbol::size_type Symbol::map_size ()
40 // Operators for better performances.
41 bool Symbol::operator== (const Symbol &rhs) const
43 return &(*_set_node) == &(*rhs.get_node());
46 bool Symbol::operator!= (const Symbol &rhs) const
48 return !(*this == rhs);
51 bool Symbol::operator<(const Symbol &rhs) const
53 return (&(*_set_node) < & (*rhs.get_node()));
56 std::wostream& operator<< (std::wostream &ostr, const Symbol &the)
58 return ostr << the.name_get();
61 wchar_t **Symbol::get_all()
63 string_set_type::const_iterator it;
64 wchar_t **resultVector = new wchar_t*[map_size()];
67 for (it = _set.begin() ; it != _set.end() ; ++it, ++i)
69 resultVector[i] = const_cast<wchar_t*>(it->c_str());
76 #endif // !SYMBOL_SYMBOL_HXX