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::getName () const
34 // Return the size of the Symbol map.
35 Symbol::size_type Symbol::getSize()
40 // Operators for better performances.
41 bool Symbol::operator== (const Symbol &rhs) const
43 return &(*_set_node) == &(*rhs.getNode());
46 bool Symbol::operator!= (const Symbol &rhs) const
48 return !(*this == rhs);
51 bool Symbol::operator<(const Symbol &rhs) const
53 // compare values instead of pointers to preserve consistency across runs, platforms, etc..
54 return *_set_node < *rhs.getNode();
57 std::wostream& operator<< (std::wostream &ostr, const Symbol &the)
59 return ostr << the.getName();
62 wchar_t **Symbol::getAll()
64 string_set_type::const_iterator it;
65 wchar_t **resultVector = new wchar_t*[getSize()];
68 for (it = _set.begin() ; it != _set.end() ; ++it, ++i)
70 resultVector[i] = const_cast<wchar_t*>(it->c_str());
77 #endif // !SYMBOL_SYMBOL_HXX