Coder Social home page Coder Social logo

embed's People

Contributors

mklimenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

embed's Issues

the same resources in subdirs are stored multiple times

Hi, congrats for your great work, but it seems that embed.exe stores dupes:

c:\MyDev\test>C:\MyDev\Contribs\embed-master\embed\x64\Release\embed.exe data -o src
embed.exe: saving data\a.txt
embed.exe: saving data\subdir\b.txt
embed.exe: saving data\subdir\c.txt
embed.exe: saving data\subdir\b.txt ... Skipped
embed.exe: saving data\subdir\c.txt ... Skipped

We can see that both subdir files are processed twice (this is the first run). And they appear twice too in the array is generated in resource_holder.hpp:

namespace {
class ResourceHolder {
private:
	std::array<Resource, 5> resources {
		Resource(resource_3021224534458533622,	resource_3021224534458533622_path),
		Resource(resource_9734938727009729610,	resource_9734938727009729610_path),
		Resource(resource_7710364344198624147,	resource_7710364344198624147_path),
		Resource(resource_9734938727009729610,	resource_9734938727009729610_path),
		Resource(resource_7710364344198624147,	resource_7710364344198624147_path),
	};

So there are 5 resources (including 2 dupes) for 3 input files...

Don't use singleton

You implement (parts of) the singleton pattern. But your whole class is static except for your convenience function call operator.
So there is not need in making the class a singleton at all. Just remove the private ctors and the singleton method and simply create a default constructed global instance embed

Why I found this: You return a reference from your singleton method but store an instance of it in the global variable. So you make a copy. Looking further I found that the whole singleton pattern makes no sense here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.