metaproxy  1.21.0
Classes | Namespaces | Functions | Variables
filter_sort.cpp File Reference
#include "config.hpp"
#include "filter_sort.hpp"
#include <metaproxy/package.hpp>
#include <metaproxy/util.hpp>
#include <yaz/diagbib1.h>
#include <yaz/copy_types.h>
#include <yaz/log.h>
#include <yaz/oid_std.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <yaz/zgdu.h>
Include dependency graph for filter_sort.cpp:

Go to the source code of this file.

Classes

class  metaproxy_1::filter::Sort::Impl
 
class  metaproxy_1::filter::Sort::Record
 
class  metaproxy_1::filter::Sort::RecordList
 
class  metaproxy_1::filter::Sort::ResultSet
 
class  metaproxy_1::filter::Sort::Frontend
 

Namespaces

 metaproxy_1
 
 metaproxy_1::filter
 

Functions

static void print_xpath_nodes (xmlNodeSetPtr nodes, FILE *output)
 
static mp::filter::Base * filter_creator ()
 

Variables

struct metaproxy_1_filter_struct metaproxy_1_filter_sort
 

Function Documentation

◆ filter_creator()

static mp::filter::Base* filter_creator ( )
static

Definition at line 747 of file filter_sort.cpp.

748 {
749  return new mp::filter::Sort;
750 }

◆ print_xpath_nodes()

static void print_xpath_nodes ( xmlNodeSetPtr  nodes,
FILE *  output 
)
static

Definition at line 123 of file filter_sort.cpp.

124 {
125  xmlNodePtr cur;
126  int size;
127  int i;
128 
129  assert(output);
130  size = nodes ? nodes->nodeNr : 0;
131 
132  fprintf(output, "Result (%d nodes):\n", size);
133  for (i = 0; i < size; ++i) {
134  assert(nodes->nodeTab[i]);
135 
136  if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL)
137  {
138  xmlNsPtr ns = (xmlNsPtr)nodes->nodeTab[i];
139  cur = (xmlNodePtr)ns->next;
140  if (cur->ns)
141  fprintf(output, "= namespace \"%s\"=\"%s\" for node %s:%s\n",
142  ns->prefix, ns->href, cur->ns->href, cur->name);
143  else
144  fprintf(output, "= namespace \"%s\"=\"%s\" for node %s\n",
145  ns->prefix, ns->href, cur->name);
146  }
147  else if (nodes->nodeTab[i]->type == XML_ELEMENT_NODE)
148  {
149  cur = nodes->nodeTab[i];
150  if (cur->ns)
151  fprintf(output, "= element node \"%s:%s\"\n",
152  cur->ns->href, cur->name);
153  else
154  fprintf(output, "= element node \"%s\"\n", cur->name);
155  }
156  else
157  {
158  cur = nodes->nodeTab[i];
159  fprintf(output, "= node \"%s\": type %d\n", cur->name, cur->type);
160  }
161  }
162 }

Referenced by metaproxy_1::filter::Sort::Record::get_xpath().

Variable Documentation

◆ metaproxy_1_filter_sort

struct metaproxy_1_filter_struct metaproxy_1_filter_sort
Initial value:
= {
0,
"sort",
}
static mp::filter::Base * filter_creator()

Definition at line 747 of file filter_sort.cpp.

Referenced by metaproxy_1::FactoryStatic::FactoryStatic().