37 std::shared_ptr<std::ostream>
code = std::make_shared<std::ostringstream>();
49 virtual void add_code(
const std::string&
code,
bool add_newline =
true);
53 bool add_object(std::shared_ptr<bpp_object>
object,
bool make_local =
false)
override;
63 virtual std::string
get_code()
const;
70 void adopt(std::shared_ptr<bpp_entity> entity);
An entity which can contain code.
Definition bpp_code_entity.h:35
void set_requires_perfect_forwarding(bool require)
Definition bpp_code_entity.cpp:205
virtual void add_code_to_next_line(const std::string &code)
Add code to the code entity's post-code buffer.
Definition bpp_code_entity.cpp:59
std::shared_ptr< std::ostream > code
Definition bpp_code_entity.h:37
std::string postline_buffer
Definition bpp_code_entity.h:39
virtual void flush_code_buffers()
Definition bpp_code_entity.cpp:84
virtual void add_code_to_previous_line(const std::string &code)
Add code to the code entity's pre-code buffer.
Definition bpp_code_entity.cpp:51
virtual void flush_postline_buffer()
Definition bpp_code_entity.cpp:74
virtual std::string get_post_code() const
Return the contents of the post-code buffer as a string.
Definition bpp_code_entity.cpp:201
virtual std::string get_pre_code() const
Return the contents of the pre-code buffer as a string.
Definition bpp_code_entity.cpp:194
virtual void flush_nextline_buffer()
Definition bpp_code_entity.cpp:64
virtual void clear_all_buffers()
Definition bpp_code_entity.cpp:90
bool requires_perfect_forwarding
Signals to bash_command_sequence entities whether they should operate in perfect forwarding mode I....
Definition bpp_code_entity.h:47
bool add_object(std::shared_ptr< bpp_object > object, bool make_local=false) override
Add an object to the code entity.
Definition bpp_code_entity.cpp:110
bool get_requires_perfect_forwarding() const
Definition bpp_code_entity.cpp:209
virtual void add_code(const std::string &code, bool add_newline=true)
Add code to the code entity.
Definition bpp_code_entity.cpp:24
virtual std::string get_code() const
Return the contents of the main code buffer as a string.
Definition bpp_code_entity.cpp:183
void adopt(std::shared_ptr< bpp_entity > entity)
Take ownership of all local objects in another entity, by moving them into this entity's local object...
Definition bpp_code_entity.cpp:221
std::string nextline_buffer
Definition bpp_code_entity.h:38
bool buffers_flushed
Definition bpp_code_entity.h:40
void destruct_local_objects(std::shared_ptr< bpp_program > program)
Destruct all local objects in the code entity.
Definition bpp_code_entity.cpp:172
The base class for all entities in the Bash++ compiler.
Definition bpp_entity.h:25
Definition bash_case.cpp:9