Bash++
Bash++ compiler internal documentation
bash_while_or_until_loop.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Andrew S. Rightenburg
3 * Bash++: Bash with classes
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7#pragma once
8
9#include <memory>
10#include <string>
11
12#include "bpp.h"
13#include "bpp_code_entity.h"
14#include "bpp_string.h"
15
16namespace bpp {
17
33 private:
34 std::shared_ptr<bpp::bash_while_or_until_condition> condition;
35 public:
36 void set_condition(std::shared_ptr<bpp::bash_while_or_until_condition> condition);
37 std::shared_ptr<bpp::bash_while_or_until_condition> get_condition() const;
38
39 std::string get_code() const override;
40 std::string get_pre_code() const override;
41 std::string get_post_code() const override;
42};
43
52
53} // namespace bpp
The condition for a while/until loop in Bash++.
Definition bash_while_or_until_loop.h:51
A while/until loop in Bash++.
Definition bash_while_or_until_loop.h:32
std::string get_code() const override
Return the contents of the main code buffer as a string.
Definition bash_while_or_until_loop.cpp:19
std::string get_pre_code() const override
Return the contents of the pre-code buffer as a string.
Definition bash_while_or_until_loop.cpp:23
std::string get_post_code() const override
Return the contents of the post-code buffer as a string.
Definition bash_while_or_until_loop.cpp:31
std::shared_ptr< bpp::bash_while_or_until_condition > condition
Definition bash_while_or_until_loop.h:34
void set_condition(std::shared_ptr< bpp::bash_while_or_until_condition > condition)
Definition bash_while_or_until_loop.cpp:11
std::shared_ptr< bpp::bash_while_or_until_condition > get_condition() const
Definition bash_while_or_until_loop.cpp:15
An entity which can contain code.
Definition bpp_code_entity.h:35
The practical difference between bpp_code_entity and bpp_string is how we handle the code buffers.
Definition bpp_string.h:77
Definition bash_case.cpp:9