Files CCore/inc/FileName.h CCore/src/FileName.cpp
FileName is a class, developed to deal with file names as required in standard handling of the directive include. It can be used with the DDL Engine.
class FileName : NoCopy
{
....
public:
// constructors
FileName() noexcept;
FileName(NothingType);
explicit FileName(StrLen file_name);
FileName(StrLen path,StrLen file_name);
~FileName();
// std move
FileName(FileName &&obj) noexcept;
FileName & operator = (FileName &&obj) noexcept;
// methods
bool operator + () const { return ok; }
bool operator ! () const { return !ok; }
StrLen getStr() const;
StrLen getPath() const;
StrLen getFile() const;
void printPos(PrinterType &out,TextPos pos) { Putobj(out,getFile(),pos); }
// swap/move objects
void objSwap(FileName &obj);
explicit FileName(ToMoveCtor<FileName> obj);
};
A FileName object contains inside a normalized full file name. If the object is in the null state, it contains empty string and useless.
Below are some definitions.
extname — non-empty file name, without '/', '\', ':' characters, may be special ( “.”, “..” ).
name — a regular file name.
General file name:
(dev:)opt(/)opt(extname/)*name
Normalized file name:
(dev:)opt(/)opt(name/)*name (dev:)opt(../)1..(name/)*name
Absolute names:
(dev:)opt/(name/)*name dev:(name/)*name
Relative names:
(name/)*name
Default constructor and Nothing-constructor create the null object.
operator + () returns true, if the object is not null.
operator ! () returns true, if the object is null.
getStr() returns the full path.
getPath() returns a path part, including trailing slash, if any.
getFile() returns a file name part.
For example, if the full name is "c:/dir/file_name.ext", then getPath() returns "c:/dir/" and getFile() returns "file_name.ext".
printPos() is a helper method, it prints the file name followed by the given text position.
FileName is swappable and movable.
FileName is std movable. The original object is nullified during the move.
The main job this class is doing inside two non-trivial constructors. The first of them
explicit FileName(StrLen file_name);
converts the given general file name into the normalized form. If the given name is bad the null object is created. Exception may be thrown if there is no enough memory.
The second
FileName(StrLen path,StrLen file_name);
prepares the normalized file name from the given path and the given general file name. If the given file name is absolute, it is normalized, but if it is relative, the given path is used to generate the full path. Again, if the given name is bad the null object is created. Exception may be thrown if there is no enough memory. path is expected to be the proper path part, like getPath() return value.


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
2-4
AWT's easy Portuguese piri-piri chicken recipe is perfect for the barbecue - and ready in 30 minutes.
To make the piri-piri sauce, preheat the oven to 180C/350F/Gas 4. Place the chillies on a roasting tray and roast them for 10 minutes.
Cool and roughly chop the chillies. Place the chillies, garlic, salt, oregano, paprika, olive oil and vinegar in a saucepan, and simmer for 2-3 minutes.
Allow the mixture to cool, then blend it to a purée in a jug blender or food processor. Store in a lidded container at room temperature; it will keep for about a month. Shake before using.
Place the spatchcocked chicken in a sealable plastic bag. Add half the piri-piri sauce, spreading it evenly over the chicken. Seal and marinate in the refrigerator for at least one hour.
Preheat the oven to 200C/390F/Gas 6, and preheat a large griddle pan on the hob. Alternatively, light your barbecue.
Season the marinated chicken, and cook it on the griddle pan for 2-3 minutes on each side, until golden brown.
Transfer the griddled chicken to a roasting tray and roast in the oven for 30 minutes, until cooked through. Alternatively, place the chicken on a medium heat barbecue, covered, for 10-15 minutes on both sides or until cooked through, basting regularly with the remaining piri-piri sauce.
Serve with chips and salad.