Crystal Space 2.0.0: 4.16.2.1 Getting the Plugin and Intro

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 4.16.2.1 Getting the Plugin and Intro

#### Getting the Plugin

This plugin has `‘crystalspace.syntax.loader.service.text’` as plugin id. Usually this plugin is already loaded if you also use the main loader plugin. In that case you can get this plugin from the object registry by doing:

    csRef<iSyntaxService> services = csQueryRegistry<iSyntaxService> (object_reg);

If you need to load the plugin yourselves then the following code would work. This code will first check if the plugin is already loaded. If not it will load it:

    csRef<iSyntaxService> services = csLoadPluginCheck<iSyntaxService> (
      object_reg, "crystalspace.syntax.loader.service.text");

#### Introduction

This plugin implements the `iSyntaxService` interface. The definition of this interface can be found in `‘imap/services.h’`. There are basically three kinds of functions in this interface:

- `‘Reporting Helpers’` These are functions that make it easier for a plugin writer to report an error to the user.
- `‘Parsing Helpers’` These functions are the main part of this plugin. They all start with `‘Parse’` and help with parsing a small part of the XML format. They all expect a node (`iDocumentNode`) to be parsed as the input and they return the parsed result or an error.
- `‘Writing Helpers’` These functions create XML (in the given `iDocumentNode` parameter) for some basic Crystal Space object. They are useful if you ware making a plugin that saves XML.

In this document we explain a few of the more important parsing functions present in this plugin.

This document was generated using texi2html 1.76.