#ifndef INCLUDED_BOBCAT_A2X_
#define INCLUDED_BOBCAT_A2X_

#include <sstream>
#include <string>

namespace FBB
{

class A2x: public std::istringstream
{
    static bool thread_local s_lastFail;

    public:
        A2x() = default;
        explicit A2x(char const *txt);          // 1.f initialize from text
        explicit A2x(std::string const &str);   // 2.f
        A2x(A2x const &other);                  // 3.f
        A2x(A2x &&tmp);                         // 4.f

        template <typename Type>
        operator Type();                        // .f

        template <typename Type>    
        Type to();                              // .f

        A2x &operator=(char const *txt);        // 1.cc

        A2x &operator=(std::string const &str); // 1.f
        A2x &operator=(A2x const &other);       // 2.f

        static bool lastFail();                 // .f
};

#include "a2x1.f"
#include "a2x2.f"
#include "a2x3.f"
#include "a2x4.f"
#include "to.f"
#include "optype.f"
#include "opis1.f"
#include "opis2.f"
#include "lastfail.f"

} // FBB

#endif
