1
2
3
4
5
6 #ifndef CMAJOR_SYMBOLS_STRING_FUNCTIONS_INCLUDED
7 #define CMAJOR_SYMBOLS_STRING_FUNCTIONS_INCLUDED
8 #include <cmajor/symbols/TypeSymbol.hpp>
9 #include <cmajor/symbols/FunctionSymbol.hpp>
10
11 namespace cmajor { namespace symbols {
12
13 class StringFunctionContainerSymbol : public TypeSymbol
14 {
15 public:
16 StringFunctionContainerSymbol();
17 StringFunctionContainerSymbol(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_);
18 void* IrType(Emitter& emitter) override;
19 void* CreateDefaultIrValue(Emitter& emitter) override;
20 void Write(SymbolWriter& writer) override;
21 void Read(SymbolReader& reader) override;
22 bool IsStringFunctionContainer() const override { return true; }
23 };
24
25 class StringLengthFunction : public FunctionSymbol
26 {
27 public:
28 StringLengthFunction(TypeSymbol* parentType);
29 StringLengthFunction(const Span& span_, const boost::uuids::uuid& sourceModuleId_, const std::u32string& name_);
30 void Write(SymbolWriter& writer) override;
31 void Read(SymbolReader& reader) override;
32 void GenerateCall(Emitter& emitter, std::std::vector<GenObject*>&genObjects, OperationFlagsflags, constSpan&span, constboost::uuids::uuid& moduleId) override;
33 std::unique_ptr<Value> ConstructValue(const std::std::vector<std::std::unique_ptr<Value>>&argumentValues, constSpan&span, constboost::uuids::uuid&moduleId, Value*receiver) const override;
34 bool IsBasicTypeOperation() const override { return true; }
35 bool IsCompileTimePrimitiveFunction() const override { return true; }
36 };
37
38 } }
39
40 #endif // CMAJOR_SYMBOLS_STRING_FUNCTIONS_INCLUDED