File: CdbPython.hh

package info (click to toggle)
cadabra2 2.4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,732 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (43 lines) | stat: -rw-r--r-- 1,487 bytes parent folder | download | duplicates (3)
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
40
41
42
43

#pragma once

#include <string>

namespace cadabra {

	std::string escape_quotes(const std::string&);

	/// \ingroup files
	/// Convert a block of Cadabra notation into pure Python. Mimics
	/// the functionality in the python script 'cadabra2'
	/// If display is false, this will not make ';' characters 
	/// generate 'display' statements (used in the conversion of
	/// notebooks to python packages).

	std::string cdb2python(const std::string&, bool display);

	std::string cdb2python_string(const std::string&, bool display);	

	/// \ingroup files
	/// As above, but for a single line; for private use only.
	/// If display is false, this will not make ';' characters 
	/// generate 'display' statements (used in the conversion of
	/// notebooks to python packages).

	std::string convert_line(const std::string&, std::string& lhs, std::string& rhs, std::string& op, std::string& indent, bool display);

	/// \ingroup files
	/// Convert a Cadabra notebook file to pure Python. This gets
	/// called on-the-fly when importing Cadabra notebooks written by
	/// users, and at install time for all system-supplied packages.
	/// If for_standalone is false, this will not make ';' characters 
	/// generate 'display' statements (used in the conversion of
	/// notebooks to python packages), and it will not convert
	/// any cells which have their `ignore_on_import` flag set.

	#ifndef CDBPYTHON_NO_NOTEBOOK

	std::string cnb2python(const std::string&, bool for_standalone);

	#endif
	}