name = $name; $this->output_dir = $out; $this->project_dir = $project; $this->output_ext = $out_ext; $this->base_dir = $base; $this->template_app = $template_app; $this->template_shared_app = $template_shared_app; $this->template_lib = $template_lib; $this->template_shared_lib = $template_shared_lib; $this->template_activex = $template_activex; $this->template_csproj = ""; $this->template_user = ""; // The template for a filters file used by VS2010. $this->template_filter = ""; $p = explode( '/', $project ); $o = array(); for( $i = 0; $i < sizeof( $p ); $i++ ) { // Skip meaningless . or empty terms. if( $p[ $i ] == '' || $p[ $i ] == '.' ) continue; array_push( $o, '..' ); } $this->project_rel_path = implode( '/', $o ); if (strlen($this->project_rel_path) > 0) $this->project_rel_path = $this->project_rel_path . "/"; } function setDelimiters( $l, $r ) { $this->ldelim = $l; $this->rdelim = $r; } function setSolutionInfo( $template_sln, $template_user, $output_ext, $template_filter = "" ) { $this->template_sln = $template_sln; $this->solution_ext = $output_ext; $this->template_user = $template_user; $this->template_filter = $template_filter; } function setDotNetInfo($template_csprog) { $this->template_csproj = $template_csprog; } function setFileExtensions() { $args = func_get_args(); $count = func_num_args(); $this->file_exts = $args; } function setSourceFileExtensions() { $args = func_get_args(); $count = func_num_args(); $this->source_file_exts = $args; } function setRejectPatterns() { $args = func_get_args(); $this->reject_patterns = $args; } function setDontCompilePatterns() { $args = func_get_args(); $this->dont_compile_patterns = $args; } function setPlatforms() { $args = func_get_args(); $this->platforms = $args; } function supportsPlatform( $platform ) { if( isset( $this->platforms ) ) foreach( $this->platforms as $rule ) if( strcmp( $rule, $platform ) == 0 ) return true; return false; } function ruleReject( $file ) { if( isset( $this->reject_patterns ) ) foreach( $this->reject_patterns as $rule ) if( preg_match( $rule, $file ) ) return true; return false; } function allowedFileExt( $file ) { foreach( $this->file_exts as $ext ) { $ext = ".{$ext}"; $extLen = strlen( $ext ); $possibleMatch = substr( $file, -$extLen, $extLen ); if( $possibleMatch == $ext ) return true; } return false; } function isSourceFile( $file ) { foreach( $this->source_file_exts as $ext ) { $ext = ".{$ext}"; $extLen = strlen( $ext ); $possibleMatch = substr( $file, -$extLen, $extLen ); if( $possibleMatch == $ext ) return true; } return false; } function isResourceFile( $file ) { $ext = ".rc"; $extLen = strlen( $ext ); $possibleMatch = substr( $file, -$extLen, $extLen ); if( $possibleMatch == $ext ) return true; return false; } } ?>