Пример #1
0
Object FrogProvider::MakeWillie(Scope& scope)
{
#if defined(USE_CACHE)
    if (m_willie)
        return *m_willie;
#endif

    Object frog = scope.NewObject();

    frog.SetFlags(OL_FLAG_STATIC_NAME|OL_FLAG_LENGTH_NAME|OL_FLAG_STATIC_VALUE|
        OL_FLAG_ALLOW_DUPLICATES);

    frog.Add(Frog_Id, OL_GuidValue(
        0X7C1D0F49, 0X0DF2, 0X4EB9, 0X8566, 0X7DFD, 0XB4283E46));
    frog.AddString(Frog_UserName, "willie");
    frog.AddString(Frog_First, "William");
    frog.AddString(Frog_Last, "Frog");
    frog.AddString(Frog_Color, "Red");
    frog.AddDate(Frog_Birthdate, Date(2006, 3, 1));

#if defined(USE_CACHE)
    m_willie = new Object(frog);
#endif

    return frog;
}
Пример #2
0
Object FrogProvider::MakeFreddy(Scope& scope)
{
#if defined(USE_CACHE)
    if (m_freddy)
        return *m_freddy;
#endif

    Object frog = scope.NewObject();

    frog.SetFlags(OL_FLAG_STATIC_NAME|OL_FLAG_LENGTH_NAME|OL_FLAG_STATIC_VALUE|
        OL_FLAG_ALLOW_DUPLICATES);

    frog.Add(Frog_Id, OL_GuidValue(
        0x430BAEEB, 0x3192, 0x46E9, 0xA244, 0x79F3, 0xD68CA03A));
    frog.AddString(Frog_UserName, "freddy");
    frog.AddString(Frog_First, "Frederick");
    frog.AddString(Frog_Last, "Frog");
    frog.AddString(Frog_Color, "Blue");
    frog.AddDate(Frog_Birthdate, Date(1991, 8, 3));

#if defined(USE_CACHE)
    m_freddy = new Object(frog);
#endif

    return frog;
}
Пример #3
0
Object FrogProvider::MakeKermit(Scope& scope)
{
#if defined(USE_CACHE)
    if (m_kermit)
        return *m_kermit;
#endif

    Object frog = scope.NewObject();

    frog.SetFlags(OL_FLAG_STATIC_NAME|OL_FLAG_LENGTH_NAME|OL_FLAG_STATIC_VALUE|
        OL_FLAG_ALLOW_DUPLICATES);

    frog.Add(Frog_Id, OL_GuidValue(
        0x1C6D09D2, 0xF1B6, 0x43F1, 0xB30B, 0xF774, 0x7822A29B));
    frog.AddString(Frog_UserName, "kermit");
    frog.AddString(Frog_First, "Kermit");
    frog.AddString(Frog_Last, "Frog");
    frog.AddString(Frog_Color, "Green");
    frog.AddDate(Frog_Birthdate, Date(1955, 12, 3));

    frog.AddNavigationLink(Frog_Friend, "Frogs('willie')");

    {
        Array arr = scope.NewArray();
        arr.AppendDate(Date(2015, 12, 31));
        arr.AppendDate(Date(2015, 12, 24));
        arr.AppendDate(Date(2015, 12, 25));
        frog.AddArray(Frog_Holidays, arr);
    }

#if defined(USE_CACHE)
    m_kermit = new Object(frog);
#endif

    return frog;
}