~ubuntu-branches/ubuntu/utopic/libcmis/utopic-proposed

« back to all changes in this revision

Viewing changes to src/libcmis/gdrive-property.cxx

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2014-02-05 14:41:34 UTC
  • mfrom: (1.1.5) (2.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140205144134-ffvov1moblfapn82
Tags: 0.4.1-3ubuntu1
* Resynchronize on Debian, remaining change:
* debian/patches/powerpc64le.diff: build on ppc64el

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* libcmis
 
2
 * Version: MPL 1.1 / GPLv2+ / LGPLv2+
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License or as specified alternatively below. You may obtain a copy of
 
7
 * the License at http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * Major Contributor(s):
 
15
 * Copyright (C) 2013 Cao Cuong Ngo <cao.cuong.ngo@gmail.com>
 
16
 *
 
17
 *
 
18
 * All Rights Reserved.
 
19
 *
 
20
 * For minor contributions see the git repository.
 
21
 *
 
22
 * Alternatively, the contents of this file may be used under the terms of
 
23
 * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
 
24
 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
 
25
 * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
 
26
 * instead of those above.
 
27
 */
 
28
 
 
29
#include "gdrive-property.hxx"
 
30
#include "property-type.hxx"
 
31
#include "gdrive-utils.hxx"
 
32
 
 
33
using namespace std;
 
34
using namespace libcmis;
 
35
 
 
36
GDriveProperty::GDriveProperty( )
 
37
{
 
38
}
 
39
 
 
40
GDriveProperty::~GDriveProperty( )
 
41
{
 
42
}
 
43
 
 
44
GDriveProperty::GDriveProperty( const string& key, Json json ):
 
45
    Property( )
 
46
{
 
47
    PropertyTypePtr propertyType( new PropertyType( ) );
 
48
    string convertedKey = GdriveUtils::toCmisKey( key );
 
49
    propertyType->setId( convertedKey );
 
50
    propertyType->setLocalName( convertedKey );
 
51
    propertyType->setLocalNamespace( convertedKey );
 
52
    propertyType->setQueryName( convertedKey );
 
53
    propertyType->setDisplayName( key );
 
54
    propertyType->setTypeFromJsonType( json.getStrType( ) );
 
55
    propertyType->setUpdatable( GdriveUtils::checkUpdatable( key ) );
 
56
    propertyType->setMultiValued( GdriveUtils::checkMultiValued( key ) );
 
57
 
 
58
    setPropertyType( propertyType );    
 
59
    
 
60
    vector< string > values = GdriveUtils::parseGdriveProperty( key, json );
 
61
    setValues( values );
 
62
}
 
63
 
 
64
GDriveProperty::GDriveProperty( const GDriveProperty& copy ) :
 
65
     libcmis::Property( copy )
 
66
{
 
67
}
 
68
 
 
69
GDriveProperty& GDriveProperty::operator=( const GDriveProperty& copy )
 
70
{
 
71
    if ( this != &copy )
 
72
    {
 
73
        libcmis::Property::operator=( copy );
 
74
    }
 
75
    return *this;
 
76
}
 
77