summaryrefslogtreecommitdiff
path: root/bPod/php/cybozuLab/rssParser/Utils.as
diff options
context:
space:
mode:
Diffstat (limited to 'bPod/php/cybozuLab/rssParser/Utils.as')
-rw-r--r--bPod/php/cybozuLab/rssParser/Utils.as1
1 files changed, 1 insertions, 0 deletions
diff --git a/bPod/php/cybozuLab/rssParser/Utils.as b/bPod/php/cybozuLab/rssParser/Utils.as
new file mode 100644
index 0000000..ddfe31c
--- /dev/null
+++ b/bPod/php/cybozuLab/rssParser/Utils.as
@@ -0,0 +1 @@
+/* Action script 2.0 RSS parser package Copyright (C) 2006 Cybozu Labs, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* class: com.cybozuLab.rssParser.Utils modified: 20/Jan/2006 Utilities for RSS parser package. */ class com.cybozuLab.rssParser.Utils { private static var INTEND_SPACE_NUMBER:Number = 3; static public function traceObj( targetObj:Object, hierarchyLevel:Number ):Void { if( hierarchyLevel == undefined ) { hierarchyLevel = 0; } for( var prop in targetObj ) { if( typeof( targetObj[prop] ) != "object" ) { trace( makeIntendSpace( hierarchyLevel ) + prop + " : " + targetObj[prop] ); } else { trace( makeIntendSpace( hierarchyLevel ) + prop ); hierarchyLevel++; traceObj( targetObj[prop], hierarchyLevel ); hierarchyLevel--; } } } static public function objToString( targetObj:Object, hierarchyLevel:Number ):String { var resultStr:String = ""; if( hierarchyLevel == undefined ) { hierarchyLevel = 0; } for( var prop in targetObj ) { if( typeof( targetObj[prop] ) != "object" ) { resultStr += makeIntendSpace( hierarchyLevel ) + prop + " : " + targetObj[prop] + "\n"; } else { resultStr += makeIntendSpace( hierarchyLevel ) + prop + "\n"; hierarchyLevel++; resultStr += objToString( targetObj[prop], hierarchyLevel ); hierarchyLevel--; } } return resultStr; } static private function makeIntendSpace( hierarchyLevel:Number ):String { var resultString:String = ""; for( var i:Number=0; i < INTEND_SPACE_NUMBER * hierarchyLevel; i++ ) { resultString += " "; } return resultString+"|-"; } static public function countProperty( targetObj:Object ):Number { var i:Number = 0; for( var prop in targetObj ) { i++; } return i; } } \ No newline at end of file