Snel
A shell implementation for A.U.TH (Operating Systems Lab)
sequencer.cpp File Reference

A basic sequence interpreter for snel. More...

#include "sequencer.h"

Go to the source code of this file.

Functions

template<typename T >
void snel::memcpy (T *to, const T *from, size_t n)
 A type-safe memcpy.
 
template<typename T , typename Container >
void snel::split (const std::basic_string< T > &str, Container &cont, T delim)
 
std::string snel::filter (const std::string in)
 

Detailed Description

A basic sequence interpreter for snel.

Sequencer.cpp Created on: Feb, 2019 Author: Christos Choutouridis AEM: 8997 email : cchou.nosp@m.tou@.nosp@m.ece.a.nosp@m.uth..nosp@m.gr

Definition in file sequencer.cpp.

Function Documentation

◆ filter()

std::string snel::filter ( const std::string  in)

A very very simple filtering for leading ' ', comments and adjustments for the '|' character.

Note
The current snel implementation requires '|' to separated from left and right from the rest of the text, so we adjust the input to fit this expectation.
Parameters
inInput string
Returns
Output string

Definition at line 49 of file sequencer.cpp.

◆ split()

template<typename T , typename Container >
void snel::split ( const std::basic_string< T > &  str,
Container &  cont,
delim 
)

Split a string to tokens and store them in a container, using a delimiter character.

Note
Requires: container with push_back functionality
Parameters
strThe input string to split
contThe container to push the tokens (MUST have .push_back(T) member)
delimThe delimiter of type T to use

Definition at line 31 of file sequencer.cpp.