~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/function.cc

  • Committer: Brian Aker
  • Date: 2010-10-28 17:12:01 UTC
  • mfrom: (1887.1.3 merge)
  • Revision ID: brian@tangent.org-20101028171201-baj6l1bnntn1s4ad
Merge in POTFILES changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <drizzled/gettext.h>
27
27
#include "drizzled/plugin/function.h"
28
 
#include <drizzled/function_container.h>
29
28
 
30
29
#include "drizzled/util/string.h"
31
30
 
 
31
using namespace std;
 
32
 
32
33
namespace drizzled
33
34
{
34
35
 
41
42
 
42
43
bool plugin::Function::addPlugin(const plugin::Function *udf)
43
44
{
44
 
  if (FunctionContainer::getMap().find(udf->getName()) != FunctionContainer::getMap().end())
45
 
  {
46
 
    errmsg_printf(error::ERROR,
47
 
                  _("A function named %s already exists!\n"),
48
 
                  udf->getName().c_str());
49
 
    return true;
50
 
  }
51
 
 
52
45
  if (udf_registry.find(udf->getName()) != udf_registry.end())
53
46
  {
54
 
    errmsg_printf(error::ERROR,
 
47
    errmsg_printf(ERRMSG_LVL_ERROR,
55
48
                  _("A function named %s already exists!\n"),
56
49
                  udf->getName().c_str());
57
50
    return true;
58
51
  }
59
 
 
60
 
  std::pair<UdfMap::iterator, bool> ret=
 
52
  pair<UdfMap::iterator, bool> ret=
61
53
    udf_registry.insert(make_pair(udf->getName(), udf));
62
54
  if (ret.second == false)
63
55
  {
64
 
    errmsg_printf(error::ERROR,
 
56
    errmsg_printf(ERRMSG_LVL_ERROR,
65
57
                  _("Could not add Function!\n"));
66
58
    return true;
67
59
  }
68
 
 
69
60
  return false;
70
61
}
71
62