Question: Project #3 - Dependency-Based CodePublisher Version 2.0, Revised: 03/21/2017 12:50:24 Due Date: Tuesday April 4th Purpose: A Code Repository is a Program responsible for managing

Project #3 - Dependency-Based CodePublisher

Version 2.0, Revised: 03/21/2017 12:50:24 Due Date: Tuesday April 4th

Purpose:

A Code Repository is a Program responsible for managing source code resources, e.g., files and documents. A fully developed Repository will support file persistance, managment of versions, and the acquisition and publication of source and document files. This project focuses on just the publishing functionality of a repository.

In this project we will develop means to display source code files as web pages with embedded child links. Each link refers to a code file that the displayed code file depends on.

There are several things you need to know in order to complete this project:

Each file to be published is a C++ source file. Our publisher will generate, for each of these, an HTML file, with most of the contents drawn from the code file.

The pages we will generate have only static content, with the exception of some embedded JavaScript and styling, so we won't need a web server.

We will need to preserve the white space structure of the displayed source code. That can be done embedding all the code between the tags

 and 

or by using the CSS white-space property with value "pre" to style a div with all the code in its contents.

Any markup characters in the code text will have to be escaped, e.g., replace < with < and > with >.

File dependencies are displayed in the web page with embedded links, which are implemented in HTML5 with anchor elements:

source code file name

For each class, we will, optionally, implement outlining, similar to the visual studio outlining feature. To do that we will use the CSS display property, with values: normal or none, to control whether the contents of a div are visible or not.

The Code Publisher will be embedded in a mock Repository with almost no functionality except to support publishing of source code as web pages. Specifically you are not expected to provide support for:

package checkin or checkout

versioning

You are expected to support:

Dependency analysis of the C++ source code files you will publish, using the analyzer you developed in Project #2.

The ability to specify, on the command line, files to be published, by providing command line arguments for path and file patterns.

The ability to display any file cited on the command line, by starting a process that runs a browser of your choice, naming the specification of the file you want to display.

Note that the CodePublisher project creates a code generator. Its inputs are C++ code and its outputs are HTML code.

Requirements:

Your CodePublisher Project:

(1) Shall use Visual Studio 2015 and its C++ Windows console projects, as provided in the ECS computer labs.

(2) Shall use the C++ standard library's streams for all console I/O and new and delete for all heap-based memory management1.

(4) Shall provide a Publisher program that provides for creation of web pages each of which captures the content of a single C++ source code file, e.g., *.h or *.cpp.

(10) Shall, optionally2 provide the facility to expand or collapse class bodies, methods, and global functions using JavaScript and CSS properties.

(2) Shall provide a CSS style sheet that the Publisher uses to style its generated pages and (if you are implementing the previous optional requirement) a JavaScript file that provides functionality to hide and unhide sections of code for outlining, using mouse clicks.

(2) Shall embed in each web page's

section links to the style sheet and JavaScript file.

(4) Shall embedd HTML5 links to dependent files with a label, at the top of the web page. Publisher shall use functionality from your Project #2 to discover package dependencies within the published set of source files.

(2) Shall develop command line processing to define the files to publish by specifying path and file patterns.

(3) Shall demonstrate the CodePublisher functionality by publishing all the important packages in your Project #3.

(5) Shall include an automated unit test suite that demonstrates you meet all the requirements of this project2.

That means that you are not allowed to use any of the C language I/0, e.g., printf, scanf, etc, nor the C memory management, e.g., calloc, malloc, or free.

This optional requirement will take a significant amount of work to complete successfully. You should get everything else working before attempting this additional effort.

This is in addition to the construction tests you include as part of every package you submit.

What you need to know:

In order to successfully meet these requirements you will need to know:

Details of the C++ language: http://CppReference.com.

HTML5, CSS, and JavaScript basics. I will provide a demo that shows you how to do most of the things web things required for this project.

All those things you learned while developing code for Projects #1, and #2.

/////////////////////////////////////////////////////////////// // Cpp11-BlockingQueue.cpp - Thread-safe Blocking Queue // // ver 1.4 // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2013 // /////////////////////////////////////////////////////////////// #include  #include  #include  #include  #include  #include  #include  #include "Cpp11-BlockingQueue.h" #ifdef TEST_BLOCKINGQUEUE using namespace Async; std::mutex ioLock; void test(BlockingQueue* pQ) { std::string msg; do { msg = pQ->deQ(); { std::lock_guard l(ioLock); std::cout << " thread deQed " << msg.c_str(); } std::this_thread::sleep_for(std::chrono::milliseconds(10)); } while(msg != "quit"); } int main() { std::cout << " Demonstrating C++11 Blocking Queue"; std::cout << " ===================================="; BlockingQueue q; std::thread t(test, &q); for(int i=0; i<15; ++i) { std::ostringstream temp; temp << i; std::string msg = std::string("msg#") + temp.str(); { std::lock_guard l(ioLock); std::cout << " main enQing " << msg.c_str(); } q.enQ(msg); std::this_thread::sleep_for(std::chrono::milliseconds(3)); } q.enQ("quit"); t.join(); std::cout << " "; std::cout << " Making move copy of BlockingQueue"; std::cout << " -----------------------------------"; std::string msg = "test"; q.enQ(msg); std::cout << " before move:"; std::cout << " q.size() = " << q.size(); std::cout << " q.front() = " << q.front(); BlockingQueue q2 = std::move(q); // move assignment std::cout << " after move:"; std::cout << " q2.size() = " << q2.size(); std::cout << " q.size() = " << q.size(); std::cout << " q2 element = " << q2.deQ() << " "; std::cout << " Move assigning state of BlockingQueue"; std::cout << " ---------------------------------------"; BlockingQueue q3; q.enQ("test"); std::cout << " before move:"; std::cout << " q.size() = " << q.size(); std::cout << " q.front() = " << q.front(); q3 = std::move(q); std::cout << " after move:"; std::cout << " q.size() = " << q.size(); std::cout << " q3.size() = " << q3.size(); std::cout << " q3 element = " << q3.deQ() << " "; std::cout << " "; } #endif 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!