Changeset 14060 for trunk/FACT++/src


Ignore:
Timestamp:
06/03/12 22:51:47 (12 years ago)
Author:
tbretz
Message:
Implemented JsState and JsName, fixed a problem in JsSleep
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/RemoteControl.h

    r14058 r14060  
    147147    virtual void JsException(const std::string &str) { fImp->Error(str); }
    148148
     149    int JsState(const string &server)
     150    {
     151        const ClientList::const_iterator l = fClientList.find(server);
     152        return l==fClientList.end() ? -256 : l->second->GetState();
     153    }
     154
     155    string JsName(const string &server)
     156    {
     157
     158        const ClientList::const_iterator l = fClientList.find(server);
     159        if (l==fClientList.end())
     160            return "";
     161
     162        return GetState(server, l->second->GetState()).name;
     163    }
     164
    149165    void JsSleep(uint32_t ms)
    150166    {
    151         const Time timeout = ms<=0 ? Time(Time::none) : Time()+boost::posix_time::millisec(ms);
     167        const Time timeout = Time()+boost::posix_time::millisec(ms==0?1:ms);
    152168
    153169        T::GetStreamOut().Display(true);
Note: See TracChangeset for help on using the changeset viewer.