aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Parser/Parser.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-11 05:54:20 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-11 05:54:20 -0400
commitd968fc51eab8b0fb259ecbeae517056b99554017 (patch)
tree10e551cff9fefbefbfd7e5031b57320116bb7fce /vendor/sabre/vobject/lib/Parser/Parser.php
parentc7698e4dc388b7d9a9db368672cb057c1d4d3a01 (diff)
parent4dd3839c41e18d9724855e7955d8737b6f52dcd6 (diff)
downloadvolse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.gz
volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.bz2
volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.zip
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'vendor/sabre/vobject/lib/Parser/Parser.php')
-rw-r--r--vendor/sabre/vobject/lib/Parser/Parser.php80
1 files changed, 80 insertions, 0 deletions
diff --git a/vendor/sabre/vobject/lib/Parser/Parser.php b/vendor/sabre/vobject/lib/Parser/Parser.php
new file mode 100644
index 000000000..ca8bc0add
--- /dev/null
+++ b/vendor/sabre/vobject/lib/Parser/Parser.php
@@ -0,0 +1,80 @@
+<?php
+
+namespace Sabre\VObject\Parser;
+
+/**
+ * Abstract parser.
+ *
+ * This class serves as a base-class for the different parsers.
+ *
+ * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+abstract class Parser {
+
+ /**
+ * Turning on this option makes the parser more forgiving.
+ *
+ * In the case of the MimeDir parser, this means that the parser will
+ * accept slashes and underscores in property names, and it will also
+ * attempt to fix Microsoft vCard 2.1's broken line folding.
+ */
+ const OPTION_FORGIVING = 1;
+
+ /**
+ * If this option is turned on, any lines we cannot parse will be ignored
+ * by the reader.
+ */
+ const OPTION_IGNORE_INVALID_LINES = 2;
+
+ /**
+ * Bitmask of parser options.
+ *
+ * @var int
+ */
+ protected $options;
+
+ /**
+ * Creates the parser.
+ *
+ * Optionally, it's possible to parse the input stream here.
+ *
+ * @param mixed $input
+ * @param int $options Any parser options (OPTION constants).
+ *
+ * @return void
+ */
+ function __construct($input = null, $options = 0) {
+
+ if (!is_null($input)) {
+ $this->setInput($input);
+ }
+ $this->options = $options;
+ }
+
+ /**
+ * This method starts the parsing process.
+ *
+ * If the input was not supplied during construction, it's possible to pass
+ * it here instead.
+ *
+ * If either input or options are not supplied, the defaults will be used.
+ *
+ * @param mixed $input
+ * @param int $options
+ *
+ * @return array
+ */
+ abstract function parse($input = null, $options = 0);
+
+ /**
+ * Sets the input data.
+ *
+ * @param mixed $input
+ *
+ * @return void
+ */
+ abstract function setInput($input);
+
+}