Subversion Repositories tpanel

Rev

Rev 271 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 271 Rev 297
Line 1139... Line 1139...
1139
{
1139
{
1140
    ulong part1 = (handle >> 16) & 0x0000ffff;
1140
    ulong part1 = (handle >> 16) & 0x0000ffff;
1141
    ulong part2 = handle & 0x0000ffff;
1141
    ulong part2 = handle & 0x0000ffff;
1142
    return std::to_string(part1)+":"+std::to_string(part2);
1142
    return std::to_string(part1)+":"+std::to_string(part2);
1143
}
1143
}
-
 
1144
 
-
 
1145
ulong extractHandle(const std::string& obname)
-
 
1146
{
-
 
1147
    size_t pos = obname.rfind("_");
-
 
1148
 
-
 
1149
    if (pos == std::string::npos)
-
 
1150
        return 0;
-
 
1151
 
-
 
1152
    std::string part = obname.substr(pos + 1);
-
 
1153
    ulong handle = 0;
-
 
1154
 
-
 
1155
    if ((pos = part.find(":")) != std::string::npos)
-
 
1156
    {
-
 
1157
        std::string slt = part.substr(0, pos);
-
 
1158
        std::string srt = part.substr(pos + 1);
-
 
1159
        ulong lt = atoi(slt.c_str());
-
 
1160
        ulong rt = atoi(srt.c_str());
-
 
1161
        handle = ((lt << 16) & 0xffff0000) | (rt & 0x0000ffff);
-
 
1162
    }
-
 
1163
 
-
 
1164
    return handle;
-
 
1165
}