File: CompilerProtocol.h

package info (click to toggle)
storm-lang 0.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 52,004 kB
  • sloc: ansic: 261,462; cpp: 140,405; sh: 14,891; perl: 9,846; python: 2,525; lisp: 2,504; asm: 860; makefile: 678; pascal: 70; java: 52; xml: 37; awk: 12
file content (39 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "Core/Io/Protocol.h"

namespace storm {
	STORM_PKG(core.lang);

	/**
	 * Protocol for files inside the compiler.
	 */
	class CompilerProtocol : public Protocol {
		STORM_CLASS;
	public:
		// Create. Give the name of the library, if any.
		STORM_CTOR CompilerProtocol();
		STORM_CTOR CompilerProtocol(Str *libName);

		// Compare two parts of a filename for equality.
		// Implemented here as a simple bitwise comparision.
		virtual Bool STORM_FN partEq(Str *a, Str *b);

		// Hash a part of a filename.
		virtual Nat STORM_FN partHash(Str *a);

		// Convert to a string suitable for other C-api:s
		virtual Str *STORM_FN format(Url *url);

		// Output.
		virtual void STORM_FN toS(StrBuf *to) const;

	protected:
		// The same protocol as some other?
		virtual Bool STORM_FN isEqualTo(const Protocol *o) const;

	private:
		// Library name (if any).
		MAYBE(Str *) libName;
	};

}