Using #pragma once instead of include guards

Just looks cleaner
This commit is contained in:
Daniel Wolf 2016-01-06 21:02:06 +01:00
parent 9e9a432f70
commit f14feefeb0
17 changed files with 17 additions and 68 deletions

View File

@ -1,5 +1,4 @@
#ifndef RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H #pragma once
#define RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H
#include <tclap/StdOutput.h> #include <tclap/StdOutput.h>
@ -15,5 +14,3 @@ private:
// Writes a longer usage message with long and short args, providing descriptions // Writes a longer usage message with long and short args, providing descriptions
void printLongUsage(TCLAP::CmdLineInterface& cli, std::ostream& outStream) const; void printLongUsage(TCLAP::CmdLineInterface& cli, std::ostream& outStream) const;
}; };
#endif //RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_PHONE_H #pragma once
#define LIPSYNC_PHONE_H
// Defines a subset of the Arpabet // Defines a subset of the Arpabet
enum class Phone { enum class Phone {
@ -75,5 +74,3 @@ Phone stringToPhone(const std::string& s);
std::string phoneToString(Phone phone); std::string phoneToString(Phone phone);
std::ostream& operator <<(std::ostream& stream, const Phone phone); std::ostream& operator <<(std::ostream& stream, const Phone phone);
#endif //LIPSYNC_PHONE_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_SHAPE_H #pragma once
#define LIPSYNC_SHAPE_H
#include <string> #include <string>
@ -21,5 +20,3 @@ enum class Shape {
std::string shapeToString(Shape shape); std::string shapeToString(Shape shape);
std::ostream& operator <<(std::ostream& stream, const Shape shape); std::ostream& operator <<(std::ostream& stream, const Shape shape);
#endif //LIPSYNC_SHAPE_H

View File

@ -1,5 +1,4 @@
#ifndef RHUBARB_LIP_SYNC_TABLEPRINTER_H #pragma once
#define RHUBARB_LIP_SYNC_TABLEPRINTER_H
#include <initializer_list> #include <initializer_list>
@ -15,5 +14,3 @@ private:
const std::vector<int> columnWidths; const std::vector<int> columnWidths;
const int columnSpacing; const int columnSpacing;
}; };
#endif //RHUBARB_LIP_SYNC_TABLEPRINTER_H

View File

@ -1,9 +1,6 @@
#ifndef APP_INFO_H #pragma once
#define APP_INFO_H
#include <string> #include <string>
extern const std::string appName; extern const std::string appName;
extern const std::string appVersion; extern const std::string appVersion;
#endif //APP_INFO_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_AUDIOSTREAM_H #pragma once
#define LIPSYNC_AUDIOSTREAM_H
class AudioStream { class AudioStream {
public: public:
@ -8,5 +7,3 @@ public:
virtual int getChannelCount() = 0; virtual int getChannelCount() = 0;
virtual bool getNextSample(float &sample) = 0; virtual bool getNextSample(float &sample) = 0;
}; };
#endif //LIPSYNC_AUDIOSTREAM_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_CHANNELDOWNMIXER_H #pragma once
#define LIPSYNC_CHANNELDOWNMIXER_H
#include "AudioStream.h" #include "AudioStream.h"
#include <memory> #include <memory>
@ -17,5 +16,3 @@ private:
std::unique_ptr<AudioStream> inputStream; std::unique_ptr<AudioStream> inputStream;
int inputChannelCount; int inputChannelCount;
}; };
#endif //LIPSYNC_CHANNELDOWNMIXER_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_SAMPLERATECONVERTER_H #pragma once
#define LIPSYNC_SAMPLERATECONVERTER_H
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -30,5 +29,3 @@ private:
float mean(double start, double end); float mean(double start, double end);
float getInputSample(int sampleIndex); float getInputSample(int sampleIndex);
}; };
#endif //LIPSYNC_SAMPLERATECONVERTER_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_WAVFILEREADER_H #pragma once
#define LIPSYNC_WAVFILEREADER_H
#include <string> #include <string>
#include <cstdint> #include <cstdint>
@ -31,5 +30,3 @@ private:
int channelCount; int channelCount;
int remainingSamples; int remainingSamples;
}; };
#endif //LIPSYNC_WAVFILEREADER_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_IOTOOLS_H #pragma once
#define LIPSYNC_IOTOOLS_H
#include <fstream> #include <fstream>
@ -40,5 +39,3 @@ namespace little_endian {
} }
} }
#endif //LIPSYNC_IOTOOLS_H

View File

@ -1,10 +1,7 @@
#ifndef LIPSYNC_WAVEFILEWRITER_H #pragma once
#define LIPSYNC_WAVEFILEWRITER_H
#include <memory> #include <memory>
#include <string> #include <string>
#include "AudioStream.h" #include "AudioStream.h"
void createWaveFile(std::unique_ptr<AudioStream> inputStream, std::string fileName); void createWaveFile(std::unique_ptr<AudioStream> inputStream, std::string fileName);
#endif //LIPSYNC_WAVEFILEWRITER_H

View File

@ -1,10 +1,7 @@
#ifndef LIPSYNC_CENTISECONDS_H #pragma once
#define LIPSYNC_CENTISECONDS_H
#include <chrono> #include <chrono>
typedef std::chrono::duration<int, std::centi> centiseconds; typedef std::chrono::duration<int, std::centi> centiseconds;
std::ostream& operator <<(std::ostream& stream, const centiseconds cs); std::ostream& operator <<(std::ostream& stream, const centiseconds cs);
#endif //LIPSYNC_CENTISECONDS_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_MOUTH_ANIMATION_H #pragma once
#define LIPSYNC_MOUTH_ANIMATION_H
#include <map> #include <map>
#include "Phone.h" #include "Phone.h"
@ -7,5 +6,3 @@
#include "Shape.h" #include "Shape.h"
std::map<centiseconds, Shape> animate(const std::map<centiseconds, Phone>& phones); std::map<centiseconds, Shape> animate(const std::map<centiseconds, Phone>& phones);
#endif //LIPSYNC_MOUTH_ANIMATION_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_PHONE_EXTRACTION_H #pragma once
#define LIPSYNC_PHONE_EXTRACTION_H
#include <map> #include <map>
#include <chrono> #include <chrono>
@ -10,5 +9,3 @@
#include "centiseconds.h" #include "centiseconds.h"
std::map<centiseconds, Phone> detectPhones(std::unique_ptr<AudioStream> audioStream); std::map<centiseconds, Phone> detectPhones(std::unique_ptr<AudioStream> audioStream);
#endif //LIPSYNC_PHONE_EXTRACTION_H

View File

@ -1,9 +1,6 @@
#ifndef LIPSYNC_PLATFORM_TOOLS_H #pragma once
#define LIPSYNC_PLATFORM_TOOLS_H
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
boost::filesystem::path getBinPath(); boost::filesystem::path getBinPath();
boost::filesystem::path getBinDirectory(); boost::filesystem::path getBinDirectory();
#endif //LIPSYNC_PLATFORM_TOOLS_H

View File

@ -1,5 +1,4 @@
#ifndef RHUBARB_LIP_SYNC_STRING_TOOLS_H #pragma once
#define RHUBARB_LIP_SYNC_STRING_TOOLS_H
#include <string> #include <string>
#include <vector> #include <vector>
@ -9,5 +8,3 @@ std::vector<std::string> splitIntoLines(const std::string& s);
std::vector<std::string> wrapSingleLineString(const std::string& s, int lineLength); std::vector<std::string> wrapSingleLineString(const std::string& s, int lineLength);
std::vector<std::string> wrapString(const std::string& s, int lineLength); std::vector<std::string> wrapString(const std::string& s, int lineLength);
#endif //RHUBARB_LIP_SYNC_STRING_TOOLS_H

View File

@ -1,5 +1,4 @@
#ifndef LIPSYNC_TOOLS_H #pragma once
#define LIPSYNC_TOOLS_H
#include <functional> #include <functional>
#include <memory> #include <memory>
@ -35,5 +34,3 @@ final_act<F> finally(const F &f) noexcept { return final_act<F>(f); }
template <class F> template <class F>
final_act<F> finally(F &&f) noexcept { return final_act<F>(std::forward<F>(f)); } final_act<F> finally(F &&f) noexcept { return final_act<F>(std::forward<F>(f)); }
#endif //LIPSYNC_TOOLS_H