IncludeCPP 3.7.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of IncludeCPP might be problematic. Click here for more details.

Files changed (49) hide show
  1. includecpp/__init__.py +59 -0
  2. includecpp/__init__.pyi +255 -0
  3. includecpp/__main__.py +4 -0
  4. includecpp/cli/__init__.py +4 -0
  5. includecpp/cli/commands.py +8270 -0
  6. includecpp/cli/config_parser.py +127 -0
  7. includecpp/core/__init__.py +19 -0
  8. includecpp/core/ai_integration.py +2132 -0
  9. includecpp/core/build_manager.py +2416 -0
  10. includecpp/core/cpp_api.py +376 -0
  11. includecpp/core/cpp_api.pyi +95 -0
  12. includecpp/core/cppy_converter.py +3448 -0
  13. includecpp/core/cssl/CSSL_DOCUMENTATION.md +2075 -0
  14. includecpp/core/cssl/__init__.py +42 -0
  15. includecpp/core/cssl/cssl_builtins.py +2271 -0
  16. includecpp/core/cssl/cssl_builtins.pyi +1393 -0
  17. includecpp/core/cssl/cssl_events.py +621 -0
  18. includecpp/core/cssl/cssl_modules.py +2803 -0
  19. includecpp/core/cssl/cssl_parser.py +2575 -0
  20. includecpp/core/cssl/cssl_runtime.py +3051 -0
  21. includecpp/core/cssl/cssl_syntax.py +488 -0
  22. includecpp/core/cssl/cssl_types.py +1512 -0
  23. includecpp/core/cssl_bridge.py +882 -0
  24. includecpp/core/cssl_bridge.pyi +488 -0
  25. includecpp/core/error_catalog.py +802 -0
  26. includecpp/core/error_formatter.py +1016 -0
  27. includecpp/core/exceptions.py +97 -0
  28. includecpp/core/path_discovery.py +77 -0
  29. includecpp/core/project_ui.py +3370 -0
  30. includecpp/core/settings_ui.py +326 -0
  31. includecpp/generator/__init__.py +1 -0
  32. includecpp/generator/parser.cpp +1903 -0
  33. includecpp/generator/parser.h +281 -0
  34. includecpp/generator/type_resolver.cpp +363 -0
  35. includecpp/generator/type_resolver.h +68 -0
  36. includecpp/py.typed +0 -0
  37. includecpp/templates/cpp.proj.template +18 -0
  38. includecpp/vscode/__init__.py +1 -0
  39. includecpp/vscode/cssl/__init__.py +1 -0
  40. includecpp/vscode/cssl/language-configuration.json +38 -0
  41. includecpp/vscode/cssl/package.json +50 -0
  42. includecpp/vscode/cssl/snippets/cssl.snippets.json +1080 -0
  43. includecpp/vscode/cssl/syntaxes/cssl.tmLanguage.json +341 -0
  44. includecpp-3.7.3.dist-info/METADATA +1076 -0
  45. includecpp-3.7.3.dist-info/RECORD +49 -0
  46. includecpp-3.7.3.dist-info/WHEEL +5 -0
  47. includecpp-3.7.3.dist-info/entry_points.txt +2 -0
  48. includecpp-3.7.3.dist-info/licenses/LICENSE +21 -0
  49. includecpp-3.7.3.dist-info/top_level.txt +1 -0
includecpp/__init__.py ADDED
@@ -0,0 +1,59 @@
1
+ from .core.cpp_api import CppApi
2
+ from .core import cssl_bridge as CSSL
3
+ import warnings
4
+
5
+ __version__ = "3.7.3"
6
+ __all__ = ["CppApi", "CSSL"]
7
+
8
+ # Module-level cache for C++ modules
9
+ _api_instance = None
10
+ _loaded_modules = {}
11
+
12
+ def _get_api():
13
+ """Get or create singleton CppApi instance."""
14
+ global _api_instance
15
+ if _api_instance is None:
16
+ _api_instance = CppApi()
17
+ return _api_instance
18
+
19
+ def __getattr__(name: str):
20
+ """Enable: from includecpp import fast_list
21
+
22
+ This hook is called when Python cannot find an attribute in this module.
23
+ It allows dynamic C++ module loading via the import system.
24
+ """
25
+ if name.startswith('_'):
26
+ raise AttributeError(f"module 'includecpp' has no attribute '{name}'")
27
+
28
+ if name in _loaded_modules:
29
+ return _loaded_modules[name]
30
+
31
+ api = _get_api()
32
+
33
+ if name not in api.registry:
34
+ available = list(api.registry.keys())
35
+ raise AttributeError(
36
+ f"Module '{name}' not found. "
37
+ f"Available: {available}. "
38
+ f"Run 'includecpp rebuild' first."
39
+ )
40
+
41
+ if api.need_update(name):
42
+ warnings.warn(
43
+ f"Module '{name}' source files changed. "
44
+ f"Run 'includecpp rebuild' to update.",
45
+ UserWarning
46
+ )
47
+
48
+ module = api.include(name)
49
+ _loaded_modules[name] = module
50
+ return module
51
+
52
+ def __dir__():
53
+ """List available attributes including C++ modules."""
54
+ base = ['CppApi', 'CSSL', '__version__']
55
+ try:
56
+ api = _get_api()
57
+ return sorted(set(base + list(api.registry.keys())))
58
+ except Exception:
59
+ return base
@@ -0,0 +1,255 @@
1
+ """Type stubs for includecpp package - VSCode IntelliSense support."""
2
+
3
+ from typing import Any, Dict, Optional, List, Literal, overload, Callable
4
+ from pathlib import Path
5
+ from types import ModuleType
6
+ import threading
7
+
8
+ # Import generated module wrappers for VSCode autocomplete
9
+ # These are created by 'includecpp rebuild' and provide module-specific type hints
10
+ try:
11
+ from .core.cpp_api_extensions import *
12
+ except ImportError:
13
+ pass # Generated during rebuild
14
+
15
+
16
+ # ========== CSSL Module - CSO Service Script Language ==========
17
+ class _CSSLModule:
18
+ """CSSL callable module created via CSSL.module()"""
19
+ def __call__(self, *args: Any) -> Any:
20
+ """Execute the module code with arguments."""
21
+ ...
22
+
23
+ class _CSSLFunctionModule:
24
+ """CSSL function module created via CSSL.makemodule()"""
25
+ def __getattr__(self, name: str) -> Callable[..., Any]:
26
+ """Get a function from the module."""
27
+ ...
28
+
29
+ class _CsslLang:
30
+ """CSSL Language interface."""
31
+
32
+ def exec(self, path_or_code: str, *args: Any) -> Any:
33
+ """Execute CSSL code or file.
34
+
35
+ Args:
36
+ path_or_code: Path to .cssl file or CSSL code string
37
+ *args: Arguments accessible via parameter.get(index)
38
+
39
+ Returns:
40
+ Execution result
41
+ """
42
+ ...
43
+
44
+ def T_exec(
45
+ self,
46
+ path_or_code: str,
47
+ *args: Any,
48
+ callback: Optional[Callable[[Any], None]] = None
49
+ ) -> threading.Thread:
50
+ """Execute CSSL code asynchronously in a thread."""
51
+ ...
52
+
53
+ def wait_all(self, timeout: Optional[float] = None) -> None:
54
+ """Wait for all async executions to complete."""
55
+ ...
56
+
57
+ def get_output(self) -> List[str]:
58
+ """Get output buffer from last execution."""
59
+ ...
60
+
61
+ def clear_output(self) -> None:
62
+ """Clear output buffer."""
63
+ ...
64
+
65
+ def set_global(self, name: str, value: Any) -> None:
66
+ """Set a global variable in CSSL runtime."""
67
+ ...
68
+
69
+ def get_global(self, name: str) -> Any:
70
+ """Get a global variable from CSSL runtime."""
71
+ ...
72
+
73
+ def module(self, code: str) -> _CSSLModule:
74
+ """Create a callable CSSL module from code."""
75
+ ...
76
+
77
+ def makemodule(self, code: str) -> _CSSLFunctionModule:
78
+ """Create a CSSL module with accessible functions."""
79
+ ...
80
+
81
+
82
+ class _CSSLBridge:
83
+ """CSSL Bridge module - access to CSSL language from Python."""
84
+
85
+ CsslLang: type[_CsslLang]
86
+
87
+ def exec(self, path_or_code: str, *args: Any) -> Any:
88
+ """Execute CSSL code or file."""
89
+ ...
90
+
91
+ def _exec(self, code: str, *args: Any) -> Any:
92
+ """Execute CSSL code (alias for exec)."""
93
+ ...
94
+
95
+ def T_exec(
96
+ self,
97
+ path_or_code: str,
98
+ *args: Any,
99
+ callback: Optional[Callable[[Any], None]] = None
100
+ ) -> threading.Thread:
101
+ """Execute CSSL code asynchronously."""
102
+ ...
103
+
104
+ def _T_exec(
105
+ self,
106
+ code: str,
107
+ *args: Any,
108
+ callback: Optional[Callable[[Any], None]] = None
109
+ ) -> threading.Thread:
110
+ """Execute CSSL code asynchronously (alias)."""
111
+ ...
112
+
113
+ def set_global(self, name: str, value: Any) -> None:
114
+ """Set a global variable."""
115
+ ...
116
+
117
+ def get_global(self, name: str) -> Any:
118
+ """Get a global variable."""
119
+ ...
120
+
121
+ def get_output(self) -> List[str]:
122
+ """Get output buffer."""
123
+ ...
124
+
125
+ def clear_output(self) -> None:
126
+ """Clear output buffer."""
127
+ ...
128
+
129
+ def module(self, code: str) -> _CSSLModule:
130
+ """Create a callable CSSL module."""
131
+ ...
132
+
133
+ def makemodule(self, code: str) -> _CSSLFunctionModule:
134
+ """Create a CSSL function module."""
135
+ ...
136
+
137
+ def get_cssl(self) -> _CsslLang:
138
+ """Get default CSSL instance."""
139
+ ...
140
+
141
+
142
+ # CSSL module instance - CSO Service Script Language
143
+ CSSL: _CSSLBridge
144
+
145
+ __version__: str
146
+
147
+ # Dynamic module access via: from includecpp import <module_name>
148
+ # Auto-generated module declarations
149
+ # These allow: from includecpp import <module_name>
150
+ # (Run 'includecpp rebuild' to generate declarations for your modules)
151
+
152
+ def __dir__() -> List[str]:
153
+ """List available modules including dynamically loaded C++ modules."""
154
+ ...
155
+
156
+ class ModuleWrapper:
157
+ """Wrapper for C++ modules with getInfo() and dynamic attributes."""
158
+
159
+ def getInfo(self) -> Dict[str, Any]:
160
+ """Get module metadata including classes, functions, and structs."""
161
+ ...
162
+
163
+ def __getattr__(self, name: str) -> Any: ...
164
+ def __dir__(self) -> List[str]: ...
165
+
166
+ class CppApi:
167
+ """Main API class for including C++ modules with type hints."""
168
+
169
+ # Inbuilt module constants
170
+ FileSystem: str
171
+ Crypto: str
172
+ JSON: str
173
+ StringUtils: str
174
+ Networking: str
175
+ DataStructures: str
176
+ Threading: str
177
+ StandardMenus: str
178
+
179
+ def __init__(
180
+ self,
181
+ verbose: bool = False,
182
+ auto_update: bool = False,
183
+ config_path: Optional[Path] = None
184
+ ) -> None: ...
185
+
186
+ @property
187
+ def Inbuilds(self) -> List[str]:
188
+ """List of available inbuilt modules."""
189
+ ...
190
+
191
+ def exists(self, module_name: str) -> bool:
192
+ """Check if a module exists."""
193
+ ...
194
+
195
+ # The include() method returns ModuleWrapper with dynamic attributes
196
+ # VSCode will show getInfo() and other attributes set at runtime
197
+ def include(
198
+ self,
199
+ module_name: str,
200
+ auto_update: Optional[bool] = None
201
+ ) -> ModuleWrapper:
202
+ """Include a C++ module.
203
+
204
+ Returns a ModuleWrapper instance with:
205
+ - getInfo() method for module metadata
206
+ - Dynamic attributes for classes, functions, and structs
207
+
208
+ Example:
209
+ crypto = api.include("crypto")
210
+ crypto.getInfo() # Get module info
211
+ crypto.Crypto() # Access Crypto class
212
+ crypto.md5(...) # Call md5 function
213
+
214
+ Args:
215
+ module_name: Name of the module to include
216
+ auto_update: Whether to auto-rebuild if outdated (default: False)
217
+
218
+ Returns:
219
+ ModuleWrapper with module-specific attributes
220
+ """
221
+ ...
222
+
223
+ def need_update(self, module_name: str) -> bool:
224
+ """Check if module needs rebuild based on source file changes.
225
+
226
+ Args:
227
+ module_name: Name of module to check
228
+
229
+ Returns:
230
+ True if source files are newer than build
231
+ """
232
+ ...
233
+
234
+ def update(self, module_name: str, verbose: Optional[bool] = None) -> None:
235
+ """Rebuild a single module.
236
+
237
+ Args:
238
+ module_name: Name of module to rebuild
239
+ verbose: Enable verbose output (default: use instance setting)
240
+ """
241
+ ...
242
+
243
+ def rebuild(
244
+ self,
245
+ verbose: bool = False,
246
+ clean: bool = False
247
+ ) -> None:
248
+ """Rebuild C++ modules."""
249
+ ...
250
+
251
+ def list_modules(self) -> List[str]:
252
+ """List all available modules."""
253
+ ...
254
+
255
+ __all__: List[str] # Includes: CppApi, CSSL, __version__
includecpp/__main__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .cli.commands import cli
2
+
3
+ if __name__ == "__main__":
4
+ cli()
@@ -0,0 +1,4 @@
1
+ from .commands import cli
2
+ from .config_parser import CppProjectConfig
3
+
4
+ __all__ = ["cli", "CppProjectConfig"]