MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getClassInfo

Function getClassInfo

tools/common_functions.php:311–415  ·  view source on GitHub ↗

@brief parses the member information form a file @param path The OpenMS path @param header The header file name @return Returns the parses information */

($bin_path, $header, $debug)

Source from the content-addressed store, hash-verified

309 @return Returns the parses information
310*/
311function getClassInfo($bin_path, $header, $debug) {
312 $members = array(
313 "classname" => substr(basename($header),
314 0,-2),
315 "public-long" => array(),
316 "public" => array(),
317 "non-public" => array(),
318 "variables" => array(),
319 "test-name" => array(),
320 );
321
322 ######################## needed stuff ###############################
323 if(!file_exists("$bin_path/doc/xml_output/"))
324 {
325 print "Error: The directory '$bin_path/doc/xml_output/' is needed!\n";
326 print " Please execute 'make doc_xml' first!\n";
327 }
328
329 ######################## load file ###############################
330 $paths = array(
331 "",
332 "Internal_1_1",
333 "Math_1_1",
334 "Logger_1_1",
335 "ims_1_1",
336 );
337
338 $found = false;
339 foreach($paths as $p)
340 {
341 //find class
342 $tmp = "$bin_path/doc/xml_output/classOpenMS_1_1".$p.$members["classname"].".xml";
343 if(file_exists($tmp))
344 {
345 $class = simplexml_load_file($tmp);
346 $found = true;
347 break;
348 }
349 //find struct
350 else
351 {
352 $tmp = "$bin_path/doc/xml_output/structOpenMS_1_1".$p.$members["classname"].".xml";
353 if(file_exists($tmp))
354 {
355 $class = simplexml_load_file($tmp);
356 $found = true;
357 break;
358 }
359 }
360 }
361 if(!$found)
362 {
363 print "Error: No XML file found for class '".$members["classname"]."'. Aborting!\n";
364 return $members;
365 }
366
367 ######################## parse ###############################
368 $classname = substr($class->compounddef->compoundname, 8);

Callers 3

correct_test.phpFile · 0.85
checker.phpFile · 0.85
create_test.phpFile · 0.85

Calls 2

parseClassInfoFromXMLFunction · 0.85
substrFunction · 0.50

Tested by

no test coverage detected