Skip to content

Commit

Permalink
refactor: reorder methods
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
deniskovalchuk committed Oct 2, 2023
1 parent 639b314 commit d69ee37
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,23 @@ reply client::set_transfer_type(transfer_type type)
return reply;
}

std::string client::make_type_command(transfer_type type)
{
if (type == transfer_type::binary)
{
return make_command("TYPE", "I");
}
else if (type == transfer_type::ascii)
{
return make_command("TYPE", "A");
}
else
{
assert(false);
return "";
}
}

transfer_type client::get_transfer_type() const
{
return transfer_type_;
Expand Down Expand Up @@ -884,23 +901,6 @@ std::string client::make_command(std::string_view command, const std::optional<s
return result;
}

std::string client::make_type_command(transfer_type type)
{
if (type == transfer_type::binary)
{
return make_command("TYPE", "I");
}
else if (type == transfer_type::ascii)
{
return make_command("TYPE", "A");
}
else
{
assert(false);
return "";
}
}

void client::notify_connected(std::string_view hostname, std::uint16_t port)
{
for (const std::shared_ptr<observer> & observer : observers_)
Expand Down

0 comments on commit d69ee37

Please sign in to comment.