classdef (Hidden = true) CodeInfoWriterProject < rtw.connectivity.CodeInfoProject
%CODEINFOWRITERPROJECT A framework for interacting with CodeInfo
%
%   This is an undocumented class. Its methods and properties are likely to
%   change without warning from one release to the next.

%   Copyright 2010-2014 The MathWorks, Inc.

    % properties
    properties (SetAccess = 'private', GetAccess = 'protected')
       writerOutputPath;
       % buffered writer
       writer;
    end
        
    methods
        % constructor
        function this = CodeInfoWriterProject(codeInfoUtils, ...
                                              writerOutputPath)
            narginchk(2, 2);
            % call super class constructor                             
            this@rtw.connectivity.CodeInfoProject(codeInfoUtils);                            
            % store writerOutputPath
            this.writerOutputPath = writerOutputPath;
        end  
        
        function writeOutput(this, append, callCBeautifier, obfuscateCode)            

            narginchk(4, 4);
            args = {'fileName',this.writerOutputPath, ...
                'append', append,...
                'callCBeautifier', callCBeautifier,...
                'obfuscateCode', obfuscateCode};
                                   
            % create the writer
            this.writer = rtw.connectivity.CodeWriter.create(args{:});            
            % write
            this.writeOutputBody;   
            % finish
            this.writer.close;
        end
    end
    
    methods (Access = 'protected', Abstract)        
        writeOutputBody(this);
    end        
end

% LocalWords:  CBeautifier
