WIP: use pt::Stream instead of a template argument
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2015, Tomasz Sowa
|
||||
/*
|
||||
* Copyright (c) 2007-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -48,12 +48,11 @@ namespace Ezc
|
||||
|
||||
|
||||
// functions or variables
|
||||
template<class StreamType>
|
||||
class Functions
|
||||
{
|
||||
public:
|
||||
|
||||
typedef void (*UserFunction)(FunInfo<StreamType> &);
|
||||
typedef void (*UserFunction)(FunInfo &);
|
||||
typedef std::map<std::wstring, UserFunction> FunctionsTable;
|
||||
typedef typename FunctionsTable::iterator Iterator;
|
||||
|
||||
@@ -79,84 +78,6 @@ private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void Functions<StreamType>::Insert(const char * key, UserFunction ufunction)
|
||||
{
|
||||
pt::utf8_to_wide(key, temp_key);
|
||||
functions_tab[temp_key] = ufunction;
|
||||
temp_key.clear();
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void Functions<StreamType>::Insert(const std::string & key, UserFunction ufunction)
|
||||
{
|
||||
Insert(key.c_str(), ufunction);
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void Functions<StreamType>::Insert(const wchar_t * key, UserFunction ufunction)
|
||||
{
|
||||
temp_key = key;
|
||||
functions_tab[temp_key] = ufunction;
|
||||
temp_key.clear();
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void Functions<StreamType>::Insert(const std::wstring & key, UserFunction ufunction)
|
||||
{
|
||||
functions_tab[key] = ufunction;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
typename Functions<StreamType>::Iterator Functions<StreamType>::Find(const std::wstring & key)
|
||||
{
|
||||
return functions_tab.find(key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void Functions<StreamType>::Clear()
|
||||
{
|
||||
functions_tab.clear();
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
typename Functions<StreamType>::Iterator Functions<StreamType>::Begin()
|
||||
{
|
||||
return functions_tab.begin();
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
typename Functions<StreamType>::Iterator Functions<StreamType>::End()
|
||||
{
|
||||
return functions_tab.end();
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
size_t Functions<StreamType>::Size() const
|
||||
{
|
||||
return functions_tab.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace Ezc
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user