Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Pike Module Reference:

module version 0.1, prepared

  MODULE Public
Modules
Standards

  MODULE Public.Standards
Modules
vCard

  MODULE Public.Standards.vCard
Classes
ContentLine
LineParser
Object
Parser

Methods
quote()
strict_parser()

Method quote

string Public.Standards.vCard.quote(string s)

Description

This module implements the vCard standard as specified in rfc 2426. It is also used to by Public.Standards.iCalendar because the format is almost the same in both cases. This module tries to be strict, i.e. it follows the rfc closely and - for instance - will not parse vCards that use "\n" as line delimiter.

Example
object parser = Public.Standards.vCard.strict_parser();
 	object vcard = parser->parse(data);
 	werror("name: %s\n", vcard["N"]->value);
	vcard["N"]->value = "John Doe";
	string s = vcard->render();
Note

Some vCard implementations do not follow the rfc. Therefore you might encounter cases where "\n" is used as a line delimiter. Its not easily possible to work around those cases automatically without breaking support in other cases. Hence this parser will not accept that as input.


Method strict_parser

object Public.Standards.vCard.strict_parser()

Description

Create a new strict parser object. Use this instead of manually creating an Public.Standards.Parser instances unless you know what you are doing.

  CLASS Public.Standards.vCard.Parser
Methods
create()
parse()
parse_cline()

Method create

void Public.Standards.vCard.Parser()->create(program|object|mapping(string : object) blueprint, void|object|mapping(string : object) parsers)

Description

Create a new Parser object.

Parameter blueprint

Use this if you want the parser to create something else than Public.Standards.vCard.Object instances.

Parameter parsers

Parsers to use for specific Components. This is used by the iCalendar module. There are no components in vCards.


Method parse

int|object Public.Standards.vCard.Parser()->parse(void|string data)

Description

Parse at most one Object. Call this every time when more data is available. Will return a parsed object if there is a complete one available. You probably want to put this into a while-loop in case data contained more than one object.


Method parse_cline

int|object Public.Standards.vCard.Parser()->parse_cline(object(.ContentLine) line)

Description

Same as parse() but is working on a Public.Parser.vCard.ContentLine instead.

  CLASS Public.Standards.vCard.ContentLine
Methods
render()
Description

Represents one line in a vCard format.

See also

Public.Standards.vCard.LineParser


Variable name

string Public.Standards.vCard.ContentLine()->name

Description

Name of the content-line (e.g. "begin", "end", "N").


Variable params

mapping(string : array(string)|string|int) Public.Standards.vCard.ContentLine()->params

Description

Parameters of the content-line. Type int is used for parameters that do not have a value.


Variable value

array(string)|string Public.Standards.vCard.ContentLine()->value

Description

Value of the content-line.


Method render

string Public.Standards.vCard.ContentLine()->render()

Description

Render the content line. Folds lines according to the specification in rfc 2425.

  CLASS Public.Standards.vCard.Object
Methods
render()
Description

Simple class representing a vCard object.


Inherit LowerCaseProperties

  • .LowerCaseProperties

  • Variable name

    string Public.Standards.vCard.Object()->name

    Description

    Name of the object. Usually "VCARD".


    Method render

    object(String.Buffer)|string Public.Standards.vCard.Object()->render(object(String.Buffer)|void buffer)

    Description

    Render the vCard to a string/String.Buffer.

      CLASS Public.Standards.vCard.LineParser
    Methods
    add_data()
    parse()
    Description

    This class parses one line of the vCard/iCalendar format at a time.


    Method add_data

    void Public.Standards.vCard.LineParser()->add_data(string data)

    Description

    Add data to the internal buffer. Will be processed on parse().


    Method parse

    object(.ContentLine) Public.Standards.vCard.LineParser()->parse(void|string data)

    Description

    Parse at most one content-line. Returns 0 if no complete content-line can be found in the buffer.

    gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University