48 // ============================= LOCAL FUNCTIONS =============================== |
48 // ============================= LOCAL FUNCTIONS =============================== |
49 |
49 |
50 // ============================ MEMBER FUNCTIONS =============================== |
50 // ============================ MEMBER FUNCTIONS =============================== |
51 |
51 |
52 // ----------------------------------------------------------------------------- |
52 // ----------------------------------------------------------------------------- |
53 // CAccConfigFileParser::ParseSubblocks |
53 // CAccConfigFileParser::ParseSubblocksL |
54 // Detecting subblocks and store them to destination array |
54 // Detecting subblocks and store them to destination array |
55 // (other items were commented in a header). |
55 // (other items were commented in a header). |
56 // ----------------------------------------------------------------------------- |
56 // ----------------------------------------------------------------------------- |
57 // |
57 // |
58 void CAccConfigFileParser::ParseSubblocks( const TUint64& aVal, |
58 void CAccConfigFileParser::ParseSubblocksL( const TUint64& aVal, |
59 RArray<TUint64>& aCaps ) |
59 RArray<TUint64>& aCaps ) |
60 { |
60 { |
61 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseSubblocks()" ); |
61 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseSubblocksL()" ); |
62 |
62 |
63 TUint64 sum( 0 ); |
63 TUint64 sum( 0 ); |
64 TUint64 curVal( 1 ); |
64 TUint64 curVal( 1 ); |
65 TInt curBit( 0 ); |
65 TInt curBit( 0 ); |
66 |
66 |
70 |
70 |
71 // Check if this subblock is defined in SB-def block |
71 // Check if this subblock is defined in SB-def block |
72 if ( ( curVal & aVal ) == curVal ) |
72 if ( ( curVal & aVal ) == curVal ) |
73 { |
73 { |
74 COM_TRACE_2( "[AccFW:SrvUtil] CAccConfigFileParser::(Cap) MATCH! HI:0x%x LO:0x%x", I64HIGH( curVal ), I64LOW( curVal ) ); |
74 COM_TRACE_2( "[AccFW:SrvUtil] CAccConfigFileParser::(Cap) MATCH! HI:0x%x LO:0x%x", I64HIGH( curVal ), I64LOW( curVal ) ); |
75 aCaps.Append( curVal ); // Append to found caps array |
75 aCaps.AppendL( curVal ); // Append to found caps array |
76 sum += curVal; |
76 sum += curVal; |
77 } |
77 } |
78 curBit++; |
78 curBit++; |
79 curVal = 2 * curVal; |
79 curVal = 2 * curVal; |
80 } |
80 } |
81 while ( sum < aVal && curBit < KAccConfigMaxCapabilityGroups ); |
81 while ( sum < aVal && curBit < KAccConfigMaxCapabilityGroups ); |
82 |
82 |
83 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseSubblocks - return void" ); |
83 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseSubblocksL - return void" ); |
84 } |
84 } |
85 |
85 |
86 // ----------------------------------------------------------------------------- |
86 // ----------------------------------------------------------------------------- |
87 // CAccConfigFileParser::ParseNames |
87 // CAccConfigFileParser::ParseNamesL |
88 // Detect all subblock names and append them to the gicen array. |
88 // Detect all subblock names and append them to the gicen array. |
89 // (other items were commented in a header). |
89 // (other items were commented in a header). |
90 // ----------------------------------------------------------------------------- |
90 // ----------------------------------------------------------------------------- |
91 // |
91 // |
92 void CAccConfigFileParser::ParseNames( const TUint32& aVal, |
92 void CAccConfigFileParser::ParseNamesL( const TUint32& aVal, |
93 RArray<TUint32>& aNames ) |
93 RArray<TUint32>& aNames ) |
94 { |
94 { |
95 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNames()" ); |
95 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNamesL()" ); |
96 TUint32 sum( 0 ); |
96 TUint32 sum( 0 ); |
97 TUint32 curVal( 1 ); |
97 TUint32 curVal( 1 ); |
98 TInt curBit( 0 ); |
98 TInt curBit( 0 ); |
99 |
99 |
100 do { |
100 do { |
101 COM_TRACE_2( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNames Binary for this roundtrip is 0x%x, total sum is 0x%x", curVal, sum ); |
101 COM_TRACE_2( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNamesL Binary for this roundtrip is 0x%x, total sum is 0x%x", curVal, sum ); |
102 COM_TRACE_1( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNames & 0x%x", curVal & aVal ); |
102 COM_TRACE_1( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNamesL & 0x%x", curVal & aVal ); |
103 // Check if this subblock is defined in SB-def block |
103 // Check if this subblock is defined in SB-def block |
104 |
104 |
105 if ( ( curVal & aVal ) == curVal ) |
105 if ( ( curVal & aVal ) == curVal ) |
106 { |
106 { |
107 COM_TRACE_1( "[AccFW:SrvUtil] (Name) MATCH! 0x%x",curVal ); |
107 COM_TRACE_1( "[AccFW:SrvUtil] (Name) MATCH! 0x%x",curVal ); |
108 aNames.Append( curVal ); // Append to found caps array |
108 aNames.AppendL( curVal ); // Append to found caps array |
109 sum += curVal; |
109 sum += curVal; |
110 } |
110 } |
111 curBit++; |
111 curBit++; |
112 curVal = 2 * curVal; |
112 curVal = 2 * curVal; |
113 } |
113 } |
114 while ( sum < aVal && curBit < KAccConfigMaxCapabilityGroups ); |
114 while ( sum < aVal && curBit < KAccConfigMaxCapabilityGroups ); |
115 |
115 |
116 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNames - return void" ); |
116 COM_TRACE_( "[AccFW:SrvUtil] CAccConfigFileParser::ParseNamesL - return void" ); |
117 } |
117 } |
118 |
118 |
119 // ----------------------------------------------------------------------------- |
119 // ----------------------------------------------------------------------------- |
120 // CAccConfigFileParser::CAccConfigFileParser |
120 // CAccConfigFileParser::CAccConfigFileParser |
121 // C++ default constructor can NOT contain any code, that |
121 // C++ default constructor can NOT contain any code, that |